projen 0.91.17 → 0.91.18

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 (492) hide show
  1. package/.jsii +3 -3
  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 +1 -1
  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 +2 -2
  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 +1 -1
  31. package/lib/component.js +1 -1
  32. package/lib/dependencies.js +1 -1
  33. package/lib/dev-env.js +1 -1
  34. package/lib/docker-compose/docker-compose-service.js +1 -1
  35. package/lib/docker-compose/docker-compose.js +1 -1
  36. package/lib/file.js +1 -1
  37. package/lib/gitattributes.js +1 -1
  38. package/lib/github/actions-provider.js +1 -1
  39. package/lib/github/auto-approve.js +1 -1
  40. package/lib/github/auto-merge.js +1 -1
  41. package/lib/github/auto-queue.js +1 -1
  42. package/lib/github/dependabot.js +1 -1
  43. package/lib/github/github-credentials.js +1 -1
  44. package/lib/github/github-project.js +1 -1
  45. package/lib/github/github.js +1 -1
  46. package/lib/github/merge-queue.js +1 -1
  47. package/lib/github/mergify.js +1 -1
  48. package/lib/github/pr-template.js +1 -1
  49. package/lib/github/pull-request-backport.js +1 -1
  50. package/lib/github/pull-request-lint.js +1 -1
  51. package/lib/github/stale.js +1 -1
  52. package/lib/github/task-workflow-job.js +1 -1
  53. package/lib/github/task-workflow.js +1 -1
  54. package/lib/github/workflow-actions.js +1 -1
  55. package/lib/github/workflow-jobs.js +1 -1
  56. package/lib/github/workflow-steps.js +1 -1
  57. package/lib/github/workflows.js +1 -1
  58. package/lib/gitlab/configuration.js +1 -1
  59. package/lib/gitlab/gitlab-configuration.js +1 -1
  60. package/lib/gitlab/nested-configuration.js +1 -1
  61. package/lib/gitpod.js +1 -1
  62. package/lib/ignore-file.js +1 -1
  63. package/lib/ini.js +1 -1
  64. package/lib/java/java-project.js +1 -1
  65. package/lib/java/junit.js +1 -1
  66. package/lib/java/maven-compile.js +1 -1
  67. package/lib/java/maven-packaging.js +1 -1
  68. package/lib/java/maven-sample.js +1 -1
  69. package/lib/java/pom.js +2 -2
  70. package/lib/java/projenrc.js +1 -1
  71. package/lib/javascript/bundler.js +1 -1
  72. package/lib/javascript/eslint.js +1 -1
  73. package/lib/javascript/jest.js +4 -4
  74. package/lib/javascript/license-checker.js +1 -1
  75. package/lib/javascript/node-package.js +1 -1
  76. package/lib/javascript/node-project.js +1 -1
  77. package/lib/javascript/npm-config.js +1 -1
  78. package/lib/javascript/prettier.js +1 -1
  79. package/lib/javascript/projenrc.js +1 -1
  80. package/lib/javascript/typescript-config.js +2 -2
  81. package/lib/javascript/upgrade-dependencies.js +2 -2
  82. package/lib/javascript/yarnrc.js +1 -1
  83. package/lib/json-patch.js +1 -1
  84. package/lib/json.js +1 -1
  85. package/lib/license.js +1 -1
  86. package/lib/logger.js +1 -1
  87. package/lib/makefile.js +1 -1
  88. package/lib/object-file.js +1 -1
  89. package/lib/project-build.js +1 -1
  90. package/lib/project-tree.js +1 -1
  91. package/lib/project.js +1 -1
  92. package/lib/projects.js +1 -1
  93. package/lib/projenrc-json.js +2 -2
  94. package/lib/projenrc.js +1 -1
  95. package/lib/python/pip.js +1 -1
  96. package/lib/python/poetry.js +2 -2
  97. package/lib/python/projenrc.js +1 -1
  98. package/lib/python/pytest-sample.js +1 -1
  99. package/lib/python/pytest.js +1 -1
  100. package/lib/python/python-project.js +1 -1
  101. package/lib/python/python-sample.js +1 -1
  102. package/lib/python/requirements-file.js +1 -1
  103. package/lib/python/setuppy.js +1 -1
  104. package/lib/python/setuptools.js +1 -1
  105. package/lib/python/venv.js +1 -1
  106. package/lib/readme.js +1 -1
  107. package/lib/release/publisher.js +1 -1
  108. package/lib/release/release-trigger.js +1 -1
  109. package/lib/release/release.js +1 -1
  110. package/lib/renovatebot.js +1 -1
  111. package/lib/sample-file.js +2 -2
  112. package/lib/semver.js +1 -1
  113. package/lib/source-code.js +1 -1
  114. package/lib/task-runtime.js +1 -1
  115. package/lib/task.js +1 -1
  116. package/lib/tasks.js +1 -1
  117. package/lib/testing.js +1 -1
  118. package/lib/textfile.js +1 -1
  119. package/lib/toml.js +1 -1
  120. package/lib/typescript/projenrc-ts.js +1 -1
  121. package/lib/typescript/projenrc.js +1 -1
  122. package/lib/typescript/typescript-typedoc.js +1 -1
  123. package/lib/typescript/typescript.js +6 -6
  124. package/lib/version.js +2 -2
  125. package/lib/vscode/devcontainer.js +1 -1
  126. package/lib/vscode/extensions.js +1 -1
  127. package/lib/vscode/launch-config.js +1 -1
  128. package/lib/vscode/settings.js +1 -1
  129. package/lib/vscode/vscode.js +1 -1
  130. package/lib/web/next.js +3 -3
  131. package/lib/web/postcss.js +1 -1
  132. package/lib/web/react.js +4 -4
  133. package/lib/web/tailwind.js +1 -1
  134. package/lib/xmlfile.js +1 -1
  135. package/lib/yaml.js +1 -1
  136. package/node_modules/{minimatch/node_modules/brace-expansion → @nodelib/fs.scandir}/LICENSE +2 -2
  137. package/node_modules/@nodelib/fs.scandir/README.md +171 -0
  138. package/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
  139. package/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
  140. package/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
  141. package/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
  142. package/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
  143. package/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
  144. package/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
  145. package/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
  146. package/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
  147. package/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
  148. package/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
  149. package/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
  150. package/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
  151. package/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
  152. package/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
  153. package/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
  154. package/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
  155. package/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
  156. package/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
  157. package/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
  158. package/node_modules/@nodelib/fs.scandir/package.json +44 -0
  159. package/node_modules/@nodelib/fs.stat/LICENSE +21 -0
  160. package/node_modules/@nodelib/fs.stat/README.md +126 -0
  161. package/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
  162. package/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
  163. package/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
  164. package/node_modules/@nodelib/fs.stat/out/index.js +26 -0
  165. package/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
  166. package/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
  167. package/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
  168. package/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
  169. package/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
  170. package/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
  171. package/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
  172. package/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
  173. package/node_modules/@nodelib/fs.stat/package.json +37 -0
  174. package/node_modules/@nodelib/fs.walk/LICENSE +21 -0
  175. package/node_modules/@nodelib/fs.walk/README.md +215 -0
  176. package/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
  177. package/node_modules/@nodelib/fs.walk/out/index.js +34 -0
  178. package/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
  179. package/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
  180. package/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
  181. package/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
  182. package/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
  183. package/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
  184. package/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
  185. package/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
  186. package/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
  187. package/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
  188. package/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
  189. package/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
  190. package/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
  191. package/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
  192. package/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
  193. package/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
  194. package/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
  195. package/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
  196. package/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
  197. package/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
  198. package/node_modules/@nodelib/fs.walk/package.json +44 -0
  199. package/node_modules/braces/LICENSE +21 -0
  200. package/node_modules/braces/README.md +586 -0
  201. package/node_modules/braces/index.js +170 -0
  202. package/node_modules/braces/lib/compile.js +60 -0
  203. package/node_modules/braces/lib/constants.js +57 -0
  204. package/node_modules/braces/lib/expand.js +113 -0
  205. package/node_modules/braces/lib/parse.js +331 -0
  206. package/node_modules/braces/lib/stringify.js +32 -0
  207. package/node_modules/braces/lib/utils.js +122 -0
  208. package/node_modules/braces/package.json +77 -0
  209. package/node_modules/end-of-stream/LICENSE +21 -0
  210. package/node_modules/end-of-stream/README.md +54 -0
  211. package/node_modules/end-of-stream/index.js +94 -0
  212. package/node_modules/end-of-stream/package.json +37 -0
  213. package/node_modules/execa/index.js +361 -0
  214. package/node_modules/execa/lib/errname.js +39 -0
  215. package/node_modules/execa/lib/stdio.js +41 -0
  216. package/node_modules/execa/license +9 -0
  217. package/node_modules/execa/node_modules/cross-spawn/LICENSE +21 -0
  218. package/node_modules/execa/node_modules/cross-spawn/README.md +94 -0
  219. package/node_modules/execa/node_modules/cross-spawn/index.js +39 -0
  220. package/node_modules/execa/node_modules/cross-spawn/lib/enoent.js +59 -0
  221. package/node_modules/execa/node_modules/cross-spawn/lib/parse.js +125 -0
  222. package/node_modules/execa/node_modules/cross-spawn/lib/util/escape.js +47 -0
  223. package/node_modules/execa/node_modules/cross-spawn/lib/util/readShebang.js +32 -0
  224. package/node_modules/execa/node_modules/cross-spawn/lib/util/resolveCommand.js +51 -0
  225. package/node_modules/execa/node_modules/cross-spawn/package.json +75 -0
  226. package/node_modules/execa/node_modules/semver/README.md +412 -0
  227. package/node_modules/execa/node_modules/semver/bin/semver +160 -0
  228. package/node_modules/execa/node_modules/semver/package.json +38 -0
  229. package/node_modules/execa/node_modules/semver/range.bnf +16 -0
  230. package/node_modules/execa/node_modules/semver/semver.js +1525 -0
  231. package/node_modules/execa/node_modules/shebang-command/index.js +19 -0
  232. package/node_modules/execa/node_modules/shebang-command/license +21 -0
  233. package/node_modules/execa/node_modules/shebang-command/package.json +39 -0
  234. package/node_modules/execa/node_modules/shebang-command/readme.md +39 -0
  235. package/node_modules/execa/node_modules/shebang-regex/index.js +2 -0
  236. package/node_modules/execa/node_modules/shebang-regex/package.json +32 -0
  237. package/node_modules/execa/node_modules/shebang-regex/readme.md +29 -0
  238. package/node_modules/{shelljs/node_modules/glob → execa/node_modules/which}/LICENSE +0 -6
  239. package/node_modules/execa/node_modules/which/README.md +51 -0
  240. package/node_modules/execa/node_modules/which/bin/which +52 -0
  241. package/node_modules/execa/node_modules/which/package.json +30 -0
  242. package/node_modules/execa/node_modules/which/which.js +135 -0
  243. package/node_modules/execa/package.json +69 -0
  244. package/node_modules/execa/readme.md +327 -0
  245. package/node_modules/fast-glob/LICENSE +21 -0
  246. package/node_modules/fast-glob/README.md +830 -0
  247. package/node_modules/fast-glob/node_modules/glob-parent/LICENSE +15 -0
  248. package/node_modules/fast-glob/node_modules/glob-parent/README.md +137 -0
  249. package/node_modules/fast-glob/node_modules/glob-parent/index.js +42 -0
  250. package/node_modules/fast-glob/node_modules/glob-parent/package.json +48 -0
  251. package/node_modules/fast-glob/out/index.d.ts +40 -0
  252. package/node_modules/fast-glob/out/index.js +102 -0
  253. package/node_modules/fast-glob/out/managers/tasks.d.ts +22 -0
  254. package/node_modules/fast-glob/out/managers/tasks.js +110 -0
  255. package/node_modules/fast-glob/out/providers/async.d.ts +9 -0
  256. package/node_modules/fast-glob/out/providers/async.js +23 -0
  257. package/node_modules/fast-glob/out/providers/filters/deep.d.ts +16 -0
  258. package/node_modules/fast-glob/out/providers/filters/deep.js +62 -0
  259. package/node_modules/fast-glob/out/providers/filters/entry.d.ts +17 -0
  260. package/node_modules/fast-glob/out/providers/filters/entry.js +85 -0
  261. package/node_modules/fast-glob/out/providers/filters/error.d.ts +8 -0
  262. package/node_modules/fast-glob/out/providers/filters/error.js +15 -0
  263. package/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +33 -0
  264. package/node_modules/fast-glob/out/providers/matchers/matcher.js +45 -0
  265. package/node_modules/fast-glob/out/providers/matchers/partial.d.ts +4 -0
  266. package/node_modules/fast-glob/out/providers/matchers/partial.js +38 -0
  267. package/node_modules/fast-glob/out/providers/provider.d.ts +19 -0
  268. package/node_modules/fast-glob/out/providers/provider.js +48 -0
  269. package/node_modules/fast-glob/out/providers/stream.d.ts +11 -0
  270. package/node_modules/fast-glob/out/providers/stream.js +31 -0
  271. package/node_modules/fast-glob/out/providers/sync.d.ts +9 -0
  272. package/node_modules/fast-glob/out/providers/sync.js +23 -0
  273. package/node_modules/fast-glob/out/providers/transformers/entry.d.ts +8 -0
  274. package/node_modules/fast-glob/out/providers/transformers/entry.js +26 -0
  275. package/node_modules/fast-glob/out/readers/async.d.ts +10 -0
  276. package/node_modules/fast-glob/out/readers/async.js +35 -0
  277. package/node_modules/fast-glob/out/readers/reader.d.ts +15 -0
  278. package/node_modules/fast-glob/out/readers/reader.js +33 -0
  279. package/node_modules/fast-glob/out/readers/stream.d.ts +14 -0
  280. package/node_modules/fast-glob/out/readers/stream.js +55 -0
  281. package/node_modules/fast-glob/out/readers/sync.d.ts +12 -0
  282. package/node_modules/fast-glob/out/readers/sync.js +43 -0
  283. package/node_modules/fast-glob/out/settings.d.ts +164 -0
  284. package/node_modules/fast-glob/out/settings.js +59 -0
  285. package/node_modules/fast-glob/out/types/index.d.ts +31 -0
  286. package/node_modules/fast-glob/out/types/index.js +2 -0
  287. package/node_modules/fast-glob/out/utils/array.d.ts +2 -0
  288. package/node_modules/fast-glob/out/utils/array.js +22 -0
  289. package/node_modules/fast-glob/out/utils/errno.d.ts +2 -0
  290. package/node_modules/fast-glob/out/utils/errno.js +7 -0
  291. package/node_modules/fast-glob/out/utils/fs.d.ts +4 -0
  292. package/node_modules/fast-glob/out/utils/fs.js +19 -0
  293. package/node_modules/fast-glob/out/utils/index.d.ts +8 -0
  294. package/node_modules/fast-glob/out/utils/index.js +17 -0
  295. package/node_modules/fast-glob/out/utils/path.d.ts +13 -0
  296. package/node_modules/fast-glob/out/utils/path.js +68 -0
  297. package/node_modules/fast-glob/out/utils/pattern.d.ts +49 -0
  298. package/node_modules/fast-glob/out/utils/pattern.js +206 -0
  299. package/node_modules/fast-glob/out/utils/stream.d.ts +4 -0
  300. package/node_modules/fast-glob/out/utils/stream.js +17 -0
  301. package/node_modules/fast-glob/out/utils/string.d.ts +2 -0
  302. package/node_modules/fast-glob/out/utils/string.js +11 -0
  303. package/node_modules/fast-glob/package.json +81 -0
  304. package/node_modules/fastq/.github/dependabot.yml +11 -0
  305. package/node_modules/fastq/.github/workflows/ci.yml +75 -0
  306. package/node_modules/fastq/LICENSE +13 -0
  307. package/node_modules/fastq/README.md +312 -0
  308. package/node_modules/fastq/SECURITY.md +15 -0
  309. package/node_modules/fastq/bench.js +66 -0
  310. package/node_modules/fastq/example.js +14 -0
  311. package/node_modules/fastq/example.mjs +11 -0
  312. package/node_modules/fastq/index.d.ts +57 -0
  313. package/node_modules/fastq/package.json +53 -0
  314. package/node_modules/fastq/queue.js +311 -0
  315. package/node_modules/fastq/test/example.ts +83 -0
  316. package/node_modules/fastq/test/promise.js +291 -0
  317. package/node_modules/fastq/test/test.js +653 -0
  318. package/node_modules/fastq/test/tsconfig.json +11 -0
  319. package/node_modules/fill-range/LICENSE +21 -0
  320. package/node_modules/fill-range/README.md +237 -0
  321. package/node_modules/fill-range/index.js +248 -0
  322. package/node_modules/fill-range/package.json +74 -0
  323. package/node_modules/get-stream/buffer-stream.js +51 -0
  324. package/node_modules/get-stream/index.js +50 -0
  325. package/node_modules/get-stream/license +9 -0
  326. package/node_modules/get-stream/package.json +46 -0
  327. package/node_modules/get-stream/readme.md +123 -0
  328. package/node_modules/is-extglob/LICENSE +21 -0
  329. package/node_modules/is-extglob/README.md +107 -0
  330. package/node_modules/is-extglob/index.js +20 -0
  331. package/node_modules/is-extglob/package.json +69 -0
  332. package/node_modules/is-glob/LICENSE +21 -0
  333. package/node_modules/is-glob/README.md +206 -0
  334. package/node_modules/is-glob/index.js +150 -0
  335. package/node_modules/is-glob/package.json +81 -0
  336. package/node_modules/is-number/LICENSE +21 -0
  337. package/node_modules/is-number/README.md +187 -0
  338. package/node_modules/is-number/index.js +18 -0
  339. package/node_modules/is-number/package.json +82 -0
  340. package/node_modules/is-stream/index.js +21 -0
  341. package/node_modules/is-stream/license +21 -0
  342. package/node_modules/is-stream/package.json +38 -0
  343. package/node_modules/is-stream/readme.md +42 -0
  344. package/node_modules/isexe/.npmignore +2 -0
  345. package/node_modules/isexe/LICENSE +15 -0
  346. package/node_modules/isexe/README.md +51 -0
  347. package/node_modules/isexe/index.js +57 -0
  348. package/node_modules/isexe/mode.js +41 -0
  349. package/node_modules/isexe/package.json +31 -0
  350. package/node_modules/isexe/test/basic.js +221 -0
  351. package/node_modules/isexe/windows.js +42 -0
  352. package/node_modules/merge2/LICENSE +21 -0
  353. package/node_modules/merge2/README.md +144 -0
  354. package/node_modules/merge2/index.js +144 -0
  355. package/node_modules/merge2/package.json +43 -0
  356. package/node_modules/micromatch/LICENSE +21 -0
  357. package/node_modules/micromatch/README.md +1024 -0
  358. package/node_modules/micromatch/index.js +474 -0
  359. package/node_modules/micromatch/package.json +119 -0
  360. package/node_modules/nice-try/LICENSE +21 -0
  361. package/node_modules/nice-try/README.md +32 -0
  362. package/node_modules/nice-try/package.json +33 -0
  363. package/node_modules/nice-try/src/index.js +12 -0
  364. package/node_modules/npm-run-path/index.js +39 -0
  365. package/node_modules/npm-run-path/license +21 -0
  366. package/node_modules/npm-run-path/package.json +45 -0
  367. package/node_modules/npm-run-path/readme.md +81 -0
  368. package/node_modules/p-finally/index.js +15 -0
  369. package/node_modules/p-finally/license +21 -0
  370. package/node_modules/p-finally/package.json +42 -0
  371. package/node_modules/p-finally/readme.md +47 -0
  372. package/node_modules/path-key/index.js +13 -0
  373. package/node_modules/path-key/license +21 -0
  374. package/node_modules/path-key/package.json +39 -0
  375. package/node_modules/path-key/readme.md +51 -0
  376. package/node_modules/picomatch/LICENSE +21 -0
  377. package/node_modules/picomatch/README.md +708 -0
  378. package/node_modules/picomatch/index.js +3 -0
  379. package/node_modules/picomatch/lib/constants.js +179 -0
  380. package/node_modules/picomatch/lib/parse.js +1091 -0
  381. package/node_modules/picomatch/lib/picomatch.js +342 -0
  382. package/node_modules/picomatch/lib/scan.js +391 -0
  383. package/node_modules/picomatch/lib/utils.js +64 -0
  384. package/node_modules/picomatch/package.json +81 -0
  385. package/node_modules/pump/.github/FUNDING.yml +2 -0
  386. package/node_modules/pump/.travis.yml +5 -0
  387. package/node_modules/pump/LICENSE +21 -0
  388. package/node_modules/pump/README.md +74 -0
  389. package/node_modules/pump/SECURITY.md +5 -0
  390. package/node_modules/pump/index.js +86 -0
  391. package/node_modules/pump/package.json +24 -0
  392. package/node_modules/pump/test-browser.js +66 -0
  393. package/node_modules/pump/test-node.js +53 -0
  394. package/node_modules/{concat-map → queue-microtask}/LICENSE +3 -1
  395. package/node_modules/queue-microtask/README.md +90 -0
  396. package/node_modules/queue-microtask/index.d.ts +2 -0
  397. package/node_modules/queue-microtask/index.js +9 -0
  398. package/node_modules/queue-microtask/package.json +55 -0
  399. package/node_modules/reusify/.github/dependabot.yml +7 -0
  400. package/node_modules/reusify/.github/workflows/ci.yml +96 -0
  401. package/node_modules/reusify/LICENSE +22 -0
  402. package/node_modules/reusify/README.md +139 -0
  403. package/node_modules/reusify/SECURITY.md +15 -0
  404. package/node_modules/reusify/benchmarks/createNoCodeFunction.js +30 -0
  405. package/node_modules/reusify/benchmarks/fib.js +13 -0
  406. package/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +38 -0
  407. package/node_modules/reusify/eslint.config.js +14 -0
  408. package/node_modules/reusify/package.json +50 -0
  409. package/node_modules/reusify/reusify.d.ts +14 -0
  410. package/node_modules/reusify/reusify.js +33 -0
  411. package/node_modules/reusify/test.js +66 -0
  412. package/node_modules/reusify/tsconfig.json +11 -0
  413. package/node_modules/run-parallel/LICENSE +20 -0
  414. package/node_modules/run-parallel/README.md +85 -0
  415. package/node_modules/run-parallel/index.js +51 -0
  416. package/node_modules/run-parallel/package.json +58 -0
  417. package/node_modules/shelljs/LICENSE +23 -20
  418. package/node_modules/shelljs/README.md +173 -65
  419. package/node_modules/shelljs/package.json +38 -22
  420. package/node_modules/shelljs/plugin.js +1 -1
  421. package/node_modules/shelljs/shell.js +70 -12
  422. package/node_modules/shelljs/src/cat.js +3 -3
  423. package/node_modules/shelljs/src/cd.js +2 -1
  424. package/node_modules/shelljs/src/chmod.js +17 -11
  425. package/node_modules/shelljs/src/cmd.js +122 -0
  426. package/node_modules/shelljs/src/common.js +103 -29
  427. package/node_modules/shelljs/src/cp.js +24 -14
  428. package/node_modules/shelljs/src/dirs.js +7 -9
  429. package/node_modules/shelljs/src/echo.js +1 -2
  430. package/node_modules/shelljs/src/errorCode.js +10 -0
  431. package/node_modules/shelljs/src/exec-child.js +60 -28
  432. package/node_modules/shelljs/src/exec.js +39 -10
  433. package/node_modules/shelljs/src/find.js +8 -3
  434. package/node_modules/shelljs/src/grep.js +15 -4
  435. package/node_modules/shelljs/src/head.js +1 -1
  436. package/node_modules/shelljs/src/ln.js +3 -1
  437. package/node_modules/shelljs/src/ls.js +29 -15
  438. package/node_modules/shelljs/src/mkdir.js +13 -11
  439. package/node_modules/shelljs/src/mv.js +4 -3
  440. package/node_modules/shelljs/src/pwd.js +1 -1
  441. package/node_modules/shelljs/src/rm.js +11 -11
  442. package/node_modules/shelljs/src/sed.js +12 -4
  443. package/node_modules/shelljs/src/set.js +0 -1
  444. package/node_modules/shelljs/src/sort.js +3 -2
  445. package/node_modules/shelljs/src/tail.js +12 -2
  446. package/node_modules/shelljs/src/test.js +3 -2
  447. package/node_modules/shelljs/src/to.js +2 -1
  448. package/node_modules/shelljs/src/toEnd.js +2 -1
  449. package/node_modules/shelljs/src/touch.js +13 -7
  450. package/node_modules/shelljs/src/uniq.js +5 -4
  451. package/node_modules/shelljs/src/which.js +5 -4
  452. package/node_modules/shx/README.md +27 -15
  453. package/node_modules/shx/lib/help.js +1 -1
  454. package/node_modules/shx/lib/shx.js +13 -8
  455. package/node_modules/shx/package.json +17 -25
  456. package/node_modules/signal-exit/LICENSE.txt +16 -0
  457. package/node_modules/signal-exit/README.md +39 -0
  458. package/node_modules/signal-exit/index.js +202 -0
  459. package/node_modules/signal-exit/package.json +38 -0
  460. package/node_modules/signal-exit/signals.js +53 -0
  461. package/node_modules/strip-eof/index.js +15 -0
  462. package/node_modules/strip-eof/license +21 -0
  463. package/node_modules/strip-eof/package.json +39 -0
  464. package/node_modules/strip-eof/readme.md +28 -0
  465. package/node_modules/to-regex-range/LICENSE +21 -0
  466. package/node_modules/to-regex-range/README.md +305 -0
  467. package/node_modules/to-regex-range/index.js +288 -0
  468. package/node_modules/to-regex-range/package.json +88 -0
  469. package/package.json +2 -2
  470. package/node_modules/concat-map/.travis.yml +0 -4
  471. package/node_modules/concat-map/README.markdown +0 -62
  472. package/node_modules/concat-map/example/map.js +0 -6
  473. package/node_modules/concat-map/index.js +0 -13
  474. package/node_modules/concat-map/package.json +0 -43
  475. package/node_modules/concat-map/test/map.js +0 -39
  476. package/node_modules/minimatch/README.md +0 -230
  477. package/node_modules/minimatch/minimatch.js +0 -947
  478. package/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -129
  479. package/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
  480. package/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -47
  481. package/node_modules/minimatch/package.json +0 -33
  482. package/node_modules/path-is-absolute/index.js +0 -20
  483. package/node_modules/path-is-absolute/package.json +0 -43
  484. package/node_modules/path-is-absolute/readme.md +0 -59
  485. package/node_modules/shelljs/commands.js +0 -29
  486. package/node_modules/shelljs/node_modules/glob/README.md +0 -378
  487. package/node_modules/shelljs/node_modules/glob/common.js +0 -238
  488. package/node_modules/shelljs/node_modules/glob/glob.js +0 -790
  489. package/node_modules/shelljs/node_modules/glob/package.json +0 -55
  490. package/node_modules/shelljs/node_modules/glob/sync.js +0 -486
  491. /package/node_modules/{minimatch → execa/node_modules/semver}/LICENSE +0 -0
  492. /package/node_modules/{path-is-absolute → execa/node_modules/shebang-regex}/license +0 -0
@@ -24,7 +24,7 @@ common.register('tail', _tail, {
24
24
  //@ var str = tail(['file1', 'file2']); // same as above
25
25
  //@ ```
26
26
  //@
27
- //@ Read the end of a `file`.
27
+ //@ Read the end of a `file`. Returns a [ShellString](#shellstringstr).
28
28
  function _tail(options, files) {
29
29
  var tail = [];
30
30
  var pipe = common.readFromPipe();
@@ -32,12 +32,20 @@ function _tail(options, files) {
32
32
  if (!files && !pipe) common.error('no paths given');
33
33
 
34
34
  var idx = 1;
35
+ var plusOption = false;
35
36
  if (options.numLines === true) {
36
37
  idx = 2;
38
+ if (arguments[1][0] === '+') {
39
+ plusOption = true;
40
+ }
37
41
  options.numLines = Number(arguments[1]);
38
42
  } else if (options.numLines === false) {
39
43
  options.numLines = 10;
40
44
  }
45
+ // arguments[0] is a json object
46
+ if (arguments[0].numLines[0] === '+') {
47
+ plusOption = true;
48
+ }
41
49
  options.numLines = -1 * Math.abs(options.numLines);
42
50
  files = [].slice.call(arguments, idx);
43
51
 
@@ -69,12 +77,14 @@ function _tail(options, files) {
69
77
  shouldAppendNewline = false;
70
78
  }
71
79
 
72
- tail = tail.concat(lines.slice(options.numLines));
80
+ tail = tail.concat(plusOption ? lines.slice(-options.numLines - 1) : lines.slice(options.numLines));
73
81
  });
74
82
 
75
83
  if (shouldAppendNewline) {
76
84
  tail.push(''); // to add a trailing newline once we join
77
85
  }
86
+
78
87
  return tail.join('\n');
79
88
  }
89
+
80
90
  module.exports = _tail;
@@ -35,10 +35,11 @@ common.register('test', _test, {
35
35
  //@
36
36
  //@ ```javascript
37
37
  //@ if (test('-d', path)) { /* do something with dir */ };
38
- //@ if (!test('-f', path)) continue; // skip if it's a regular file
38
+ //@ if (!test('-f', path)) continue; // skip if it's not a regular file
39
39
  //@ ```
40
40
  //@
41
- //@ Evaluates `expression` using the available primaries and returns corresponding value.
41
+ //@ Evaluates `expression` using the available primaries and returns
42
+ //@ corresponding boolean value.
42
43
  function _test(options, path) {
43
44
  if (!path) common.error('no path given');
44
45
 
@@ -18,7 +18,8 @@ common.register('to', _to, {
18
18
  //@
19
19
  //@ Analogous to the redirection operator `>` in Unix, but works with
20
20
  //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix
21
- //@ redirections, `to()` will overwrite any existing file!_
21
+ //@ redirections, `to()` will overwrite any existing file!_ Returns the same
22
+ //@ [ShellString](#shellstringstr) this operated on, to support chaining.
22
23
  function _to(options, file) {
23
24
  if (!file) common.error('wrong arguments');
24
25
 
@@ -17,7 +17,8 @@ common.register('toEnd', _toEnd, {
17
17
  //@ ```
18
18
  //@
19
19
  //@ Analogous to the redirect-and-append operator `>>` in Unix, but works with
20
- //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.).
20
+ //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). Returns the
21
+ //@ same [ShellString](#shellstringstr) this operated on, to support chaining.
21
22
  function _toEnd(options, file) {
22
23
  if (!file) common.error('wrong arguments');
23
24
 
@@ -20,20 +20,26 @@ common.register('touch', _touch, {
20
20
  //@ + `-a`: Change only the access time
21
21
  //@ + `-c`: Do not create any files
22
22
  //@ + `-m`: Change only the modification time
23
- //@ + `-d DATE`: Parse `DATE` and use it instead of current time
24
- //@ + `-r FILE`: Use `FILE`'s times instead of current time
23
+ //@ + `{'-d': someDate}`, `{date: someDate}`: Use a `Date` instance (ex. `someDate`)
24
+ //@ instead of current time
25
+ //@ + `{'-r': file}`, `{reference: file}`: Use `file`'s times instead of current
26
+ //@ time
25
27
  //@
26
28
  //@ Examples:
27
29
  //@
28
30
  //@ ```javascript
29
31
  //@ touch('source.js');
30
- //@ touch('-c', '/path/to/some/dir/source.js');
31
- //@ touch({ '-r': FILE }, '/path/to/some/dir/source.js');
32
+ //@ touch('-c', 'path/to/file.js');
33
+ //@ touch({ '-r': 'referenceFile.txt' }, 'path/to/file.js');
34
+ //@ touch({ '-d': new Date('December 17, 1995 03:24:00'), '-m': true }, 'path/to/file.js');
35
+ //@ touch({ date: new Date('December 17, 1995 03:24:00') }, 'path/to/file.js');
32
36
  //@ ```
33
37
  //@
34
- //@ Update the access and modification times of each `FILE` to the current time.
35
- //@ A `FILE` argument that does not exist is created empty, unless `-c` is supplied.
36
- //@ This is a partial implementation of [`touch(1)`](http://linux.die.net/man/1/touch).
38
+ //@ Update the access and modification times of each file to the current time.
39
+ //@ A file argument that does not exist is created empty, unless `-c` is supplied.
40
+ //@ This is a partial implementation of
41
+ //@ [`touch(1)`](http://linux.die.net/man/1/touch). Returns a
42
+ //@ [ShellString](#shellstringstr) indicating success or failure.
37
43
  function _touch(opts, files) {
38
44
  if (!files) {
39
45
  common.error('no files given');
@@ -36,7 +36,8 @@ common.register('uniq', _uniq, {
36
36
  //@ uniq('-cd', 'foo.txt', 'bar.txt');
37
37
  //@ ```
38
38
  //@
39
- //@ Filter adjacent matching lines from `input`.
39
+ //@ Filter adjacent matching lines from `input`. Returns a
40
+ //@ [ShellString](#shellstringstr).
40
41
  function _uniq(options, input, output) {
41
42
  // Check if this is coming from a pipe
42
43
  var pipe = common.readFromPipe();
@@ -54,9 +55,9 @@ function _uniq(options, input, output) {
54
55
  common.error(output + ': Is a directory');
55
56
  }
56
57
 
57
- var lines = (input ? fs.readFileSync(input, 'utf8') : pipe).
58
- trimRight().
59
- split('\n');
58
+ var lines = (input ? fs.readFileSync(input, 'utf8') : pipe)
59
+ .trimRight()
60
+ .split('\n');
60
61
 
61
62
  var compare = function (a, b) {
62
63
  return options.ignoreCase ?
@@ -53,7 +53,8 @@ function checkPath(pathName) {
53
53
  //@
54
54
  //@ Searches for `command` in the system's `PATH`. On Windows, this uses the
55
55
  //@ `PATHEXT` variable to append the extension if it's not already executable.
56
- //@ Returns string containing the absolute path to `command`.
56
+ //@ Returns a [ShellString](#shellstringstr) containing the absolute path to
57
+ //@ `command`.
57
58
  function _which(options, cmd) {
58
59
  if (!cmd) common.error('must specify command');
59
60
 
@@ -63,7 +64,7 @@ function _which(options, cmd) {
63
64
  var queryMatches = [];
64
65
 
65
66
  // No relative/absolute paths provided?
66
- if (cmd.indexOf('/') === -1) {
67
+ if (!cmd.includes('/')) {
67
68
  // Assume that there are no extensions to append to queries (this is the
68
69
  // case for unix)
69
70
  var pathExtArray = [''];
@@ -85,8 +86,8 @@ function _which(options, cmd) {
85
86
  attempt = attempt.toUpperCase();
86
87
  }
87
88
 
88
- var match = attempt.match(/\.[^<>:"/\|?*.]+$/);
89
- if (match && pathExtArray.indexOf(match[0]) >= 0) { // this is Windows-only
89
+ var match = attempt.match(/\.[^<>:"/|?*.]+$/);
90
+ if (match && pathExtArray.includes(match[0])) { // this is Windows-only
90
91
  // The user typed a query with the file extension, like
91
92
  // `which('node.exe')`
92
93
  if (checkPath(attempt)) {
@@ -1,7 +1,7 @@
1
1
  # Shx
2
2
 
3
- [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fshelljs%2Fshx%2Fbadge%3Fref%3Dmaster&style=flat-square)](https://actions-badge.atrox.dev/shelljs/shx/goto?ref=master)
4
- [![Codecov](https://img.shields.io/codecov/c/github/shelljs/shx/master.svg?style=flat-square&label=coverage)](https://codecov.io/gh/shelljs/shx)
3
+ [![GitHub Actions](https://img.shields.io/github/actions/workflow/status/shelljs/shx/main.yml?style=flat-square&logo=github)](https://github.com/shelljs/shx/actions/workflows/main.yml)
4
+ [![Codecov](https://img.shields.io/codecov/c/github/shelljs/shx/main.svg?style=flat-square&label=coverage)](https://codecov.io/gh/shelljs/shx)
5
5
  [![npm version](https://img.shields.io/npm/v/shx.svg?style=flat-square)](https://www.npmjs.com/package/shx)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/shx.svg?style=flat-square)](https://www.npmjs.com/package/shx)
7
7
 
@@ -9,7 +9,7 @@
9
9
  commands, providing an easy solution for simple Unix-like, cross-platform
10
10
  commands in npm package scripts.
11
11
 
12
- `shx` is proudly tested on every node release since <!-- start minVersion -->`v6`<!-- stop minVersion -->!
12
+ `shx` is proudly tested on every LTS node release since <!-- start minVersion -->`v18`<!-- stop minVersion -->!
13
13
 
14
14
  ## Difference Between ShellJS and shx
15
15
 
@@ -59,6 +59,8 @@ sub
59
59
  $ shx rm -r sub # options work as well
60
60
 
61
61
  $ shx --silent ls fakeFileName # silence error output
62
+
63
+ $ shx --negate test -d dir # Negate status code output (e.g., failed commands will now have status 0)
62
64
  ```
63
65
 
64
66
  All commands internally call the ShellJS corresponding function, guaranteeing
@@ -71,19 +73,26 @@ platform-independent scripts, we recommend you go with that.
71
73
 
72
74
  However, `shx` is ideal for one-liners inside `package.json`:
73
75
 
74
- ```javascript
76
+ ```json
75
77
  {
76
78
  "scripts": {
77
- "clean": "shx rm -rf build dist && shx echo Done"
79
+ "clean": "shx rm -rf \"build/**/*.js\" \"build/output\" && shx echo \"Done cleaning\""
78
80
  }
79
81
  }
80
82
  ```
81
83
 
82
- **Tip:** because Windows treats single quotes (ex. `'some string'`) differently
83
- than double quotes, [we
84
- recommend](https://github.com/shelljs/shx/issues/165#issuecomment-563127983)
85
- wrapping your arguments in double quotes for cross platform compatibility (ex.
86
- `"some string"`).
84
+ It's safe to use `&&` and `||` operators in npm package scripts. These will be
85
+ interpreted by the operating system's shell (`sh` on Unix, `cmd.exe` on
86
+ Windows). If you're using glob operators like `*` or `**`, then we recommend to
87
+ **put these in double quotes**, which ensures that `shx` will expand the glob
88
+ rather than the operating system shell.
89
+
90
+ > [!IMPORTANT]
91
+ > Windows treats single quotes (ex. `'some string'`) differently than double
92
+ > quotes.
93
+ > [We recommend](https://github.com/shelljs/shx/issues/165#issuecomment-563127983)
94
+ > wrapping your arguments in **escaped double quotes** so that your code is
95
+ > compatible cross platform (ex. `"clean": "shx echo \"some string\""`).
87
96
 
88
97
  ## Command reference
89
98
 
@@ -114,7 +123,7 @@ characters in the file path.
114
123
 
115
124
  ### Unsupported Commands
116
125
 
117
- As mentioned above, most ShellJS commands are supported in ShellJS. Due to the
126
+ As mentioned above, most ShellJS commands are supported in `shx`. Due to the
118
127
  differences in execution environments between ShellJS and `shx` (JS vs CLI) the
119
128
  following commands are not supported:
120
129
 
@@ -136,10 +145,13 @@ supported options:
136
145
 
137
146
  | [`set`](https://github.com/shelljs/shelljs#setoptions) flag | [`shell.config`](https://github.com/shelljs/shelljs#configuration) setting | shx command | Effect |
138
147
  |:---:| --- | --- | --- |
139
- | `-e` | `config.fatal = true` | Not supported | Exit upon first error |
140
- | `-v` | `config.verbose = true` | `shx --verbose cd foo` | Log the command as it's run |
141
- | `-f` | `config.noglob = true` | `shx --noglob cat '*.txt'` | Don't expand wildcards |
142
- | N/A | `config.silent = true` | `shx --silent cd noexist` | Don't show error output |
148
+ | `-e` | `config.fatal = true` | Not supported | Exit upon first error. |
149
+ | `-v` | `config.verbose = true` | `shx --verbose cd foo` | Log the command as it's run. |
150
+ | `-f` | `config.noglob = true` | `shx --noglob cat '*.txt'` | Don't expand wildcards. |
151
+ | N/A | `config.silent = true` | `shx --silent cd noexist` | Don't show error output. |
152
+ | N/A | N/A | `shx --negate test -d dir` | Runs the specified command but negates the exit status. Failed command = status 0, successful command = status 1. |
153
+ | N/A | N/A | `shx --help` | Show help text. |
154
+ | N/A | N/A | `shx --version` | Print the shx version. |
143
155
 
144
156
  ## Team
145
157
 
@@ -13,7 +13,7 @@ var _config = require('./config');
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
 
15
15
  // Global options defined directly in shx.
16
- var locallyDefinedOptions = ['version'];
16
+ var locallyDefinedOptions = ['version', 'negate'];
17
17
 
18
18
  var shxOptions = Object.keys(_shelljs2.default.config).filter(function (key) {
19
19
  return typeof _shelljs2.default.config[key] !== 'function';
@@ -5,14 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.shx = shx;
7
7
 
8
- var _shelljs = require('shelljs');
9
-
10
- var _shelljs2 = _interopRequireDefault(_shelljs);
11
-
12
- var _minimist = require('minimist');
13
-
14
- var _minimist2 = _interopRequireDefault(_minimist);
15
-
16
8
  var _path = require('path');
17
9
 
18
10
  var _path2 = _interopRequireDefault(_path);
@@ -21,6 +13,14 @@ var _fs = require('fs');
21
13
 
22
14
  var _fs2 = _interopRequireDefault(_fs);
23
15
 
16
+ var _shelljs = require('shelljs');
17
+
18
+ var _shelljs2 = _interopRequireDefault(_shelljs);
19
+
20
+ var _minimist = require('minimist');
21
+
22
+ var _minimist2 = _interopRequireDefault(_minimist);
23
+
24
24
  var _help = require('./help');
25
25
 
26
26
  var _help2 = _interopRequireDefault(_help);
@@ -146,6 +146,11 @@ function shx(argv) {
146
146
  code = ret ? 0 : 1;
147
147
  }
148
148
 
149
+ // Check for negation flag, and flip the code value
150
+ if (parsedArgs.negate === true) {
151
+ code = Number(!code);
152
+ }
153
+
149
154
  if (typeof code === 'number') {
150
155
  return code;
151
156
  } else if (_shelljs2.default.error()) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shx",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "description": "Portable Shell Commands for Node",
5
5
  "bin": {
6
6
  "shx": "lib/cli.js"
@@ -12,20 +12,14 @@
12
12
  "check-node-support": "node scripts/check-node-support",
13
13
  "prebuild": "rimraf lib",
14
14
  "build": "babel src -d lib",
15
- "build:watch": "npm run build -- -w",
16
- "dev": "concurrently -rk 'npm run build:watch' 'npm run lint:watch'",
17
15
  "lint": "eslint .",
18
- "lint:fix": "npm run lint --silent -- --fix",
19
- "lint:watch": "watch 'npm run lint --silent' src test",
20
16
  "prepublish": "npm run build",
21
- "posttest": "npm run lint --silent",
17
+ "posttest": "npm run lint",
22
18
  "release:major": "shelljs-release major",
23
19
  "release:minor": "shelljs-release minor",
24
20
  "release:patch": "shelljs-release patch",
25
21
  "changelog": "shelljs-changelog",
26
- "codecov": "codecov",
27
- "test": "nyc --reporter=text --reporter=lcov mocha",
28
- "test:watch": "concurrently -rk 'npm run test --silent -- -w' 'npm run lint:watch'"
22
+ "test": "nyc --reporter=text --reporter=lcov mocha"
29
23
  },
30
24
  "repository": {
31
25
  "type": "git",
@@ -55,26 +49,24 @@
55
49
  "babel-cli": "^6.6.5",
56
50
  "babel-preset-env": "^1.7.0",
57
51
  "babel-register": "^6.7.2",
58
- "codecov": "^3.0.2",
59
- "concurrently": "^2.1.0",
60
- "eslint": "^5.16.0",
61
- "eslint-config-airbnb-base": "^13.1.0",
62
- "eslint-plugin-import": "^2.17.3",
63
- "js-yaml": "^3.12.0",
64
- "mocha": "^6.1.4",
65
- "nyc": "^14.1.1",
66
- "rimraf": "^2.5.2",
52
+ "eslint": "^8.57.1",
53
+ "eslint-config-airbnb-base": "^15.0.0",
54
+ "eslint-import-resolver-node": "0.3.7",
55
+ "eslint-plugin-import": "^2.31.0",
56
+ "js-yaml": "^4.1.0",
57
+ "mocha": "^11.1.0",
58
+ "nyc": "^17.1.0",
59
+ "rimraf": "^5.0.10",
67
60
  "shelljs-changelog": "^0.2.6",
68
- "shelljs-plugin-open": "^0.2.1",
69
- "shelljs-release": "^0.5.1",
70
- "should": "^13.2.3",
71
- "watch": "^1.0.2"
61
+ "shelljs-plugin-open": "^0.3.0",
62
+ "shelljs-release": "^0.5.3",
63
+ "should": "^13.2.3"
72
64
  },
73
65
  "dependencies": {
74
- "minimist": "^1.2.3",
75
- "shelljs": "^0.8.5"
66
+ "minimist": "^1.2.8",
67
+ "shelljs": "^0.9.2"
76
68
  },
77
69
  "engines": {
78
- "node": ">=6"
70
+ "node": ">=18"
79
71
  }
80
72
  }
@@ -0,0 +1,16 @@
1
+ The ISC License
2
+
3
+ Copyright (c) 2015, Contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software
6
+ for any purpose with or without fee is hereby granted, provided
7
+ that the above copyright notice and this permission notice
8
+ appear in all copies.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
12
+ OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
13
+ LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
14
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
15
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
16
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,39 @@
1
+ # signal-exit
2
+
3
+ [![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit)
4
+ [![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master)
5
+ [![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit)
6
+ [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
7
+
8
+ When you want to fire an event no matter how a process exits:
9
+
10
+ * reaching the end of execution.
11
+ * explicitly having `process.exit(code)` called.
12
+ * having `process.kill(pid, sig)` called.
13
+ * receiving a fatal signal from outside the process
14
+
15
+ Use `signal-exit`.
16
+
17
+ ```js
18
+ var onExit = require('signal-exit')
19
+
20
+ onExit(function (code, signal) {
21
+ console.log('process exited!')
22
+ })
23
+ ```
24
+
25
+ ## API
26
+
27
+ `var remove = onExit(function (code, signal) {}, options)`
28
+
29
+ The return value of the function is a function that will remove the
30
+ handler.
31
+
32
+ Note that the function *only* fires for signals if the signal would
33
+ cause the process to exit. That is, there are no other listeners, and
34
+ it is a fatal signal.
35
+
36
+ ## Options
37
+
38
+ * `alwaysLast`: Run this handler after any other signal or exit
39
+ handlers. This causes `process.emit` to be monkeypatched.
@@ -0,0 +1,202 @@
1
+ // Note: since nyc uses this module to output coverage, any lines
2
+ // that are in the direct sync flow of nyc's outputCoverage are
3
+ // ignored, since we can never get coverage for them.
4
+ // grab a reference to node's real process object right away
5
+ var process = global.process
6
+
7
+ const processOk = function (process) {
8
+ return process &&
9
+ typeof process === 'object' &&
10
+ typeof process.removeListener === 'function' &&
11
+ typeof process.emit === 'function' &&
12
+ typeof process.reallyExit === 'function' &&
13
+ typeof process.listeners === 'function' &&
14
+ typeof process.kill === 'function' &&
15
+ typeof process.pid === 'number' &&
16
+ typeof process.on === 'function'
17
+ }
18
+
19
+ // some kind of non-node environment, just no-op
20
+ /* istanbul ignore if */
21
+ if (!processOk(process)) {
22
+ module.exports = function () {
23
+ return function () {}
24
+ }
25
+ } else {
26
+ var assert = require('assert')
27
+ var signals = require('./signals.js')
28
+ var isWin = /^win/i.test(process.platform)
29
+
30
+ var EE = require('events')
31
+ /* istanbul ignore if */
32
+ if (typeof EE !== 'function') {
33
+ EE = EE.EventEmitter
34
+ }
35
+
36
+ var emitter
37
+ if (process.__signal_exit_emitter__) {
38
+ emitter = process.__signal_exit_emitter__
39
+ } else {
40
+ emitter = process.__signal_exit_emitter__ = new EE()
41
+ emitter.count = 0
42
+ emitter.emitted = {}
43
+ }
44
+
45
+ // Because this emitter is a global, we have to check to see if a
46
+ // previous version of this library failed to enable infinite listeners.
47
+ // I know what you're about to say. But literally everything about
48
+ // signal-exit is a compromise with evil. Get used to it.
49
+ if (!emitter.infinite) {
50
+ emitter.setMaxListeners(Infinity)
51
+ emitter.infinite = true
52
+ }
53
+
54
+ module.exports = function (cb, opts) {
55
+ /* istanbul ignore if */
56
+ if (!processOk(global.process)) {
57
+ return function () {}
58
+ }
59
+ assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
60
+
61
+ if (loaded === false) {
62
+ load()
63
+ }
64
+
65
+ var ev = 'exit'
66
+ if (opts && opts.alwaysLast) {
67
+ ev = 'afterexit'
68
+ }
69
+
70
+ var remove = function () {
71
+ emitter.removeListener(ev, cb)
72
+ if (emitter.listeners('exit').length === 0 &&
73
+ emitter.listeners('afterexit').length === 0) {
74
+ unload()
75
+ }
76
+ }
77
+ emitter.on(ev, cb)
78
+
79
+ return remove
80
+ }
81
+
82
+ var unload = function unload () {
83
+ if (!loaded || !processOk(global.process)) {
84
+ return
85
+ }
86
+ loaded = false
87
+
88
+ signals.forEach(function (sig) {
89
+ try {
90
+ process.removeListener(sig, sigListeners[sig])
91
+ } catch (er) {}
92
+ })
93
+ process.emit = originalProcessEmit
94
+ process.reallyExit = originalProcessReallyExit
95
+ emitter.count -= 1
96
+ }
97
+ module.exports.unload = unload
98
+
99
+ var emit = function emit (event, code, signal) {
100
+ /* istanbul ignore if */
101
+ if (emitter.emitted[event]) {
102
+ return
103
+ }
104
+ emitter.emitted[event] = true
105
+ emitter.emit(event, code, signal)
106
+ }
107
+
108
+ // { <signal>: <listener fn>, ... }
109
+ var sigListeners = {}
110
+ signals.forEach(function (sig) {
111
+ sigListeners[sig] = function listener () {
112
+ /* istanbul ignore if */
113
+ if (!processOk(global.process)) {
114
+ return
115
+ }
116
+ // If there are no other listeners, an exit is coming!
117
+ // Simplest way: remove us and then re-send the signal.
118
+ // We know that this will kill the process, so we can
119
+ // safely emit now.
120
+ var listeners = process.listeners(sig)
121
+ if (listeners.length === emitter.count) {
122
+ unload()
123
+ emit('exit', null, sig)
124
+ /* istanbul ignore next */
125
+ emit('afterexit', null, sig)
126
+ /* istanbul ignore next */
127
+ if (isWin && sig === 'SIGHUP') {
128
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
129
+ // so use a supported signal instead
130
+ sig = 'SIGINT'
131
+ }
132
+ /* istanbul ignore next */
133
+ process.kill(process.pid, sig)
134
+ }
135
+ }
136
+ })
137
+
138
+ module.exports.signals = function () {
139
+ return signals
140
+ }
141
+
142
+ var loaded = false
143
+
144
+ var load = function load () {
145
+ if (loaded || !processOk(global.process)) {
146
+ return
147
+ }
148
+ loaded = true
149
+
150
+ // This is the number of onSignalExit's that are in play.
151
+ // It's important so that we can count the correct number of
152
+ // listeners on signals, and don't wait for the other one to
153
+ // handle it instead of us.
154
+ emitter.count += 1
155
+
156
+ signals = signals.filter(function (sig) {
157
+ try {
158
+ process.on(sig, sigListeners[sig])
159
+ return true
160
+ } catch (er) {
161
+ return false
162
+ }
163
+ })
164
+
165
+ process.emit = processEmit
166
+ process.reallyExit = processReallyExit
167
+ }
168
+ module.exports.load = load
169
+
170
+ var originalProcessReallyExit = process.reallyExit
171
+ var processReallyExit = function processReallyExit (code) {
172
+ /* istanbul ignore if */
173
+ if (!processOk(global.process)) {
174
+ return
175
+ }
176
+ process.exitCode = code || /* istanbul ignore next */ 0
177
+ emit('exit', process.exitCode, null)
178
+ /* istanbul ignore next */
179
+ emit('afterexit', process.exitCode, null)
180
+ /* istanbul ignore next */
181
+ originalProcessReallyExit.call(process, process.exitCode)
182
+ }
183
+
184
+ var originalProcessEmit = process.emit
185
+ var processEmit = function processEmit (ev, arg) {
186
+ if (ev === 'exit' && processOk(global.process)) {
187
+ /* istanbul ignore else */
188
+ if (arg !== undefined) {
189
+ process.exitCode = arg
190
+ }
191
+ var ret = originalProcessEmit.apply(this, arguments)
192
+ /* istanbul ignore next */
193
+ emit('exit', process.exitCode, null)
194
+ /* istanbul ignore next */
195
+ emit('afterexit', process.exitCode, null)
196
+ /* istanbul ignore next */
197
+ return ret
198
+ } else {
199
+ return originalProcessEmit.apply(this, arguments)
200
+ }
201
+ }
202
+ }