Skip to content

[Snyk] Upgrade typescript from 4.8.4 to 4.9.5 - #1

Merged
SherfeyInv merged 1 commit into
masterfrom
snyk-upgrade-c346dfa2e35904bda513311aa1ed03c5
Jun 30, 2024
Merged

SherfeyInv merged 1 commit into
masterfrom
snyk-upgrade-c346dfa2e35904bda513311aa1ed03c5

Conversation

@SherfeyInv

Copy link
Copy Markdown
Owner

This PR was automatically created by Snyk using the credentials of a real user.


![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)

Snyk has created this PR to upgrade typescript from 4.8.4 to 4.9.5.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 83 versions ahead of your current version.

  • The recommended version was released on a year ago.

Release notes
Package name: typescript
  • 4.9.5 - 2023-01-30
  • 4.9.4 - 2022-12-07
  • 4.9.3 - 2022-11-15
  • 4.9.2-rc - 2022-11-01
  • 4.9.1-beta - 2022-09-23
  • 4.9.0-dev.20221031 - 2022-10-31
  • 4.9.0-dev.20221030 - 2022-10-30
  • 4.9.0-dev.20221029 - 2022-10-29
  • 4.9.0-dev.20221028 - 2022-10-28
  • 4.9.0-dev.20221027 - 2022-10-27
  • 4.9.0-dev.20221026 - 2022-10-26
  • 4.9.0-dev.20221025 - 2022-10-25
  • 4.9.0-dev.20221024 - 2022-10-24
  • 4.9.0-dev.20221023 - 2022-10-23
  • 4.9.0-dev.20221022 - 2022-10-22
  • 4.9.0-dev.20221021 - 2022-10-21
  • 4.9.0-dev.20221020 - 2022-10-20
  • 4.9.0-dev.20221019 - 2022-10-19
  • 4.9.0-dev.20221018 - 2022-10-18
  • 4.9.0-dev.20221017 - 2022-10-17
  • 4.9.0-dev.20221016 - 2022-10-16
  • 4.9.0-dev.20221015 - 2022-10-15
  • 4.9.0-dev.20221014 - 2022-10-14
  • 4.9.0-dev.20221013 - 2022-10-13
  • 4.9.0-dev.20221012 - 2022-10-12
  • 4.9.0-dev.20221011 - 2022-10-11
  • 4.9.0-dev.20221007 - 2022-10-07
  • 4.9.0-dev.20221006 - 2022-10-06
  • 4.9.0-dev.20221005 - 2022-10-05
  • 4.9.0-dev.20221004 - 2022-10-04
  • 4.9.0-dev.20221003 - 2022-10-03
  • 4.9.0-dev.20221002 - 2022-10-02
  • 4.9.0-dev.20221001 - 2022-10-01
  • 4.9.0-dev.20220930 - 2022-09-30
  • 4.9.0-dev.20220929 - 2022-09-29
  • 4.9.0-dev.20220928 - 2022-09-28
  • 4.9.0-dev.20220927 - 2022-09-27
  • 4.9.0-dev.20220926 - 2022-09-26
  • 4.9.0-dev.20220925 - 2022-09-25
  • 4.9.0-dev.20220924 - 2022-09-24
  • 4.9.0-dev.20220923 - 2022-09-23
  • 4.9.0-dev.20220922 - 2022-09-22
  • 4.9.0-dev.20220921 - 2022-09-21
  • 4.9.0-dev.20220920 - 2022-09-20
  • 4.9.0-dev.20220919 - 2022-09-19
  • 4.9.0-dev.20220918 - 2022-09-18
  • 4.9.0-dev.20220917 - 2022-09-17
  • 4.9.0-dev.20220916 - 2022-09-16
  • 4.9.0-dev.20220915 - 2022-09-15
  • 4.9.0-dev.20220914 - 2022-09-14
  • 4.9.0-dev.20220913 - 2022-09-13
  • 4.9.0-dev.20220912 - 2022-09-12
  • 4.9.0-dev.20220911 - 2022-09-11
  • 4.9.0-dev.20220910 - 2022-09-10
  • 4.9.0-dev.20220909 - 2022-09-09
  • 4.9.0-dev.20220908 - 2022-09-08
  • 4.9.0-dev.20220907 - 2022-09-07
  • 4.9.0-dev.20220905 - 2022-09-05
  • 4.9.0-dev.20220904 - 2022-09-04
  • 4.9.0-dev.20220903 - 2022-09-03
  • 4.9.0-dev.20220902 - 2022-09-02
  • 4.9.0-dev.20220901 - 2022-09-01
  • 4.9.0-dev.20220831 - 2022-08-31
  • 4.9.0-dev.20220830 - 2022-08-30
  • 4.9.0-dev.20220829 - 2022-08-29
  • 4.9.0-dev.20220828 - 2022-08-28
  • 4.9.0-dev.20220827 - 2022-08-27
  • 4.9.0-dev.20220825 - 2022-08-25
  • 4.9.0-dev.20220824 - 2022-08-24
  • 4.9.0-dev.20220823 - 2022-08-23
  • 4.9.0-dev.20220822 - 2022-08-22
  • 4.9.0-dev.20220821 - 2022-08-21
  • 4.9.0-dev.20220820 - 2022-08-20
  • 4.9.0-dev.20220819 - 2022-08-19
  • 4.9.0-dev.20220818 - 2022-08-18
  • 4.9.0-dev.20220817 - 2022-08-17
  • 4.9.0-dev.20220816 - 2022-08-16
  • 4.9.0-dev.20220815 - 2022-08-15
  • 4.9.0-dev.20220814 - 2022-08-14
  • 4.9.0-dev.20220813 - 2022-08-13
  • 4.9.0-dev.20220812 - 2022-08-12
  • 4.9.0-dev.20220811 - 2022-08-11
  • 4.9.0-beta - 2022-09-23
  • 4.8.4 - 2022-09-27
from typescript GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

Snyk has created this PR to upgrade typescript from 4.8.4 to 4.9.5.

See this package in npm:
typescript

See this project in Snyk:
https://app.snyk.io/org/sherfeyinv/project/e31943af-0ba8-4268-af6d-ad837b975fd3?utm_source=github&utm_medium=referral&page=upgrade-pr
@SherfeyInv
SherfeyInv merged commit ff593c2 into master Jun 30, 2024
@SherfeyInv
SherfeyInv deleted the snyk-upgrade-c346dfa2e35904bda513311aa1ed03c5 branch June 30, 2024 10:06
SherfeyInv pushed a commit that referenced this pull request May 7, 2026
nrwl#34640)

Bun includes extra consecutive async frames for async functions in call
stacks, causing `preventRecursionInGraphConstruction` to falsely detect
a recursive loop during normal project graph construction.

## Root Cause

`preventRecursionInGraphConstruction` uses `getCallSites().slice(2)` to
skip the top 2 frames (itself +
`buildProjectGraphAndSourceMapsWithoutDaemon`), then checks if
`buildProjectGraphAndSourceMapsWithoutDaemon` appears again in the
remaining frames.

In Bun, `buildProjectGraphAndSourceMapsWithoutDaemon` appears **twice
consecutively** due to async frame duplication — leaving one occurrence
after the slice, which incorrectly triggers the loop error.

**Node call stack (after `slice(2)`):**
```
#0 createProjectGraphAndSourceMapsAsync  ← clean
#1 createProjectGraphAsync
#2 runOne
```

**Bun call stack (after `slice(2)`):**
```
#0 buildProjectGraphAndSourceMapsWithoutDaemon  ← false positive!
#1 createProjectGraphAndSourceMapsAsync
#2 createProjectGraphAndSourceMapsAsync         ← Bun duplicates async frames
#3 createProjectGraphAsync
```

## Fix

Since the call stack recursion check does not work reliably under Bun,
`preventRecursionInGraphConstruction` now returns early when running
under Bun, detected via `'Bun' in globalThis` — consistent with the
existing Bun runtime detection pattern used elsewhere in the codebase
(e.g., `isolated-plugin.ts`). The original `slice(2)` logic is preserved
unchanged for Node.js and other runtimes.

```ts
export function preventRecursionInGraphConstruction() {
  // Bun's async stack traces include extra frames that cause false positives in the
  // recursion check below, so we skip the check when running under Bun.
  if ('Bun' in globalThis) {
    return;
  }
  // ... existing Node.js check ...
}
```

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>


----

*This section details on the original issue you should resolve*

<issue_title>getCallSites output differs between Node and Bun triggering
loop detection</issue_title>
<issue_description>### Current Behavior

Hey team,

I am trying to use Bun (1.3.5) instead of Node (v22.17.0) for running Nx
(v22.1.3) and bumped into the following error:

Command:
```bash
bunx --bun nx run api:build
```

Error:
```
 NX   Project graph construction cannot be performed due to a loop detected in the call stack. This can happen if 'createProjectGraphAsync' is called directly or indirectly during project graph construction.

To avoid this, you can add a check against "global.NX_GRAPH_CREATION" before calling "createProjectGraphAsync".
Call stack:
buildProjectGraphAndSourceMapsWithoutDaemon (/app/node_modules/.pnpm/nx@22.1.3_@swc-node+register@1.10.9_@swc+core@1.11.1_@swc+helpers@0.5.15__@swc+types@0.1.18_t_twtgkxomntuzxcyp4ewkmtxn2q/node_modules/nx/src/project-graph/project-graph.js:81:62)
createProjectGraphAndSourceMapsAsync (/app/node_modules/.pnpm/nx@22.1.3_@swc-node+register@1.10.9_@swc+core@1.11.1_@swc+helpers@0.5.15__@swc+types@0.1.18_t_twtgkxomntuzxcyp4ewkmtxn2q/node_modules/nx/src/project-graph/project-graph.js:274:31)
createProjectGraphAndSourceMapsAsync (/app/node_modules/.pnpm/nx@22.1.3_@swc-node+register@1.10.9_@swc+core@1.11.1_@swc+helpers@0.5.15__@swc+types@0.1.18_t_twtgkxomntuzxcyp4ewkmtxn2q/node_modules/nx/src/project-graph/project-graph.js:225:53)
createProjectGraphAsync (/app/node_modules/.pnpm/nx@22.1.3_@swc-node+register@1.10.9_@swc+core@1.11.1_@swc+helpers@0.5.15__@swc+types@0.1.18_t_twtgkxomntuzxcyp4ewkmtxn2q/node_modules/nx/src/project-graph/project-graph.js:222:45)
createProjectGraphAsync (/app/node_modules/.pnpm/nx@22.1.3_@swc-node+register@1.10.9_@swc+core@1.11.1_@swc+helpers@0.5.15__@swc+types@0.1.18_t_twtgkxomntuzxcyp4ewkmtxn2q/node_modules/nx/src/project-graph/project-graph.js:205:40)
runOne (/app/node_modules/.pnpm/nx@22.1.3_@swc-node+register@1.10.9_@swc+core@1.11.1_@swc+helpers@0.5.15__@swc+types@0.1.18_t_twtgkxomntuzxcyp4ewkmtxn2q/node_modules/nx/src/command-line/run/run-one.js:23:52)
runOne (/app/node_modules/.pnpm/nx@22.1.3_@swc-node+register@1.10.9_@swc+core@1.11.1_@swc+helpers@0.5.15__@swc+types@0.1.18_t_twtgkxomntuzxcyp4ewkmtxn2q/node_modules/nx/src/command-line/run/run-one.js:16:23)
Pass --verbose to see the stacktrace.
```

After some digging I found that the stack trace produced by
https://github.com/nrwl/nx/blob/691bb320ce1e9cc2872e1a1b364d3fdeb9e1ad0e/packages/nx/src/utils/call-sites.ts
differs between Node and Bun. When
https://github.com/nrwl/nx/blob/691bb320ce1e9cc2872e1a1b364d3fdeb9e1ad0e/packages/nx/src/project-graph/project-graph.ts#L422
is run, the produced function call tracing is:

Node (v22.17.0):
```
nrwl/nx#0 createProjectGraphAndSourceMapsAsync
nrwl#1 createProjectGraphAsync
nrwl#2 runOne
nrwl#3 <anonymous>
nrwl#4 <anonymous>
nrwl#5 handleErrors
nrwl#6 handler
```

Bun (1.3.5):
```
nrwl/nx#0 buildProjectGraphAndSourceMapsWithoutDaemon <- This entry causes Nx to detect a loop
nrwl#1 createProjectGraphAndSourceMapsAsync
nrwl#2 createProjectGraphAndSourceMapsAsync
nrwl#3 createProjectGraphAsync
nrwl#4 createProjectGraphAsync
nrwl#5 runOne
nrwl#6 runOne
```

This is not a Nx bug per-se, but wondering if this falls into the
efforts of supporting Bun into Nx (i.e.
https://nx.dev/blog/nx-19-5-adds-stackblitz-new-features-and-more#bun-and-pnpm-v9-support)?

I will cross post the above into the Bun repo too for input.

### Expected Behavior

Able to execute Nx commands with Bun

### GitHub Repo

_No response_

### Steps to Reproduce

1. Run bunx --bun nx run api:build


### Nx Report

```shell
NX_DAEMON=true bunx --bun nx --disableNxCache --disableRemoteCache --outputStyle dynamic-legacy report                       1 ✘  16:18:00 

 NX   Report complete - copy this into the issue template

Node           : 24.3.0
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 9.6.0

nx                     : 22.1.3
@nx/js                 : 22.1.3
@nx/jest               : 22.1.3
@nx/eslint             : 22.1.3
@nx/workspace          : 22.1.3
@nx/cypress            : 22.1.3
@nx/devkit             : 22.1.3
@nx/esbuild            : 22.1.3
@nx/eslint-plugin      : 22.1.3
@nx/module-federation  : 22.1.3
@nx/nest               : 22.1.3
@nx/next               : 22.1.3
@nx/node               : 22.1.3
@nx/playwright         : 22.1.3
@nx/plugin             : 22.1.3
@nx/react              : 22.1.3
@nx/rollup             : 22.1.3
@nx/storybook          : 22.1.3
@nx/vite               : 22.1.3
@nx/vitest             : 22.1.3
@nx/web                : 22.1.3
@nx/webpack            : 22.1.3
@nx/docker             : 22.1.3
nx-cloud               : 19.1.0
@nrwl/nx-cloud         : 19.1.0
typescript             : 5.7.3
---------------------------------------
Registered Plugins:
@nxlv/python
---------------------------------------
Community plu...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes nrwl#33997

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/nrwl/nx/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AgentEnder <6933928+AgentEnder@users.noreply.github.com>
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: Copilot <Copilot@users.noreply.github.com>
SherfeyInv pushed a commit that referenced this pull request May 7, 2026
…wl#35083)

## Current Behavior

CNW rejects "." and absolute paths (e.g. `/tmp/acme`) as workspace
names, causing over 1,300 INVALID_WORKSPACE_NAME and DIRECTORY_EXISTS
errors per month. This is the #1 input validation error for both AI
agents and humans.

## Expected Behavior

- "." and "./" in a non-empty directory suggests using `nx init` instead
- "." and "./" in an empty directory resolves to the directory's
basename and creates the workspace in-place
- Absolute paths like `/tmp/acme` extract the basename as the workspace
name and create the workspace at the specified location

The `workingDir` override is threaded through `CreateWorkspaceOptions`
to downstream functions (`createWorkspace`, `createEmptyWorkspace`,
`createPreset`, `cloneTemplate`) without mutating `process.cwd()`.

## Related Issue(s)

Closes NXC-4172
SherfeyInv pushed a commit that referenced this pull request May 7, 2026
## Current Behavior

Searching for `nx.json` on nx.dev/docs does not surface the actual
nx.json reference page in the top results. The `.NET Plugin for Nx` and
other technology introduction pages rank higher because they have
`weight: 5` in frontmatter, which inflates their body text scoring via
Pagefind's `data-pagefind-weight` attribute (~25x impact via quadratic
scaling). The same issue affects `project.json`, `inputs`, and other
reference pages.

## Expected Behavior

Reference pages whose title exactly matches the search query should rank
first or near the top. Technology introduction pages should still be
discoverable for their framework name but should not outrank reference
pages for terms they merely mention in body text.

**After this change:**
- `nx.json` → "nx.json Reference" is `#1` (was `#7+`)
- `project.json` → "Project Configuration" is `#1`
- `angular` → "Angular Plugin for Nx" is `#1` (preserved)
- `nest` → "Nest.js Plugin for Nx" is `#1` (preserved)
- `react` → "React Plugin for Nx" is `#2` (React Native `#1` — valid
match)

**Changes:**
- Reduce `weight` on 35 technology introduction pages from `5` → `2` to
reduce body text inflation while keeping a modest boost
- Reduce `weight` on adding-to-monorepo guide from `6.4` → `2`
- Adjust Pagefind ranking params: `termFrequency: 0.75 → 0.65`,
`pageLength: 0.5 → 0.3` to reduce the penalty on long reference pages

## Related Issue(s)

Fixes DOC-475

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SherfeyInv pushed a commit that referenced this pull request Aug 17, 2026
…rwl#34927)

## Description

Fixes an infinite restart loop in `nx serve` that occurs when using the
`@nx/webpack:webpack` executor with a standard `webpack.config.js`
(non-composable path).

The root cause is that the `watch` option from the executor is not
propagated to the webpack configuration object when the `withNx()`
helper is bypassed. Because `config.watch` remains undefined,
`runWebpack()` defaults to a single-run build and completes the
observable immediately. The `@nx/js:node` executor interprets this
completion as a signal to restart the process, creating a loop every ~2
seconds regardless of file changes.

This was previously "accidentally" working for users of the composable
path (`withNx`) because that utility handles the flag internally. This
fix ensures the standard plugin path is also respected.

## Current Behavior
Using a plain `webpack.config.js` with the `NxAppWebpackPlugin` results
in `watch` being set to `undefined` in the final config.

```javascript
// webpack.config.js
const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');

module.exports = {
  plugins: [new NxAppWebpackPlugin({ target: 'node', ... })],
};
```

Running `nx serve` triggers a build, the observable completes, and the
Node process restarts indefinitely.

## Expected Behavior
The `options.watch` flag from the executor should be forwarded to the
final webpack config. This ensures the build observable remains open
between rebuilds, preventing unnecessary process restarts.

## How to Verify
1. Create a Node/NestJS application using a standard `webpack.config.js`
(not using `composePlugins`).
2. Run `nx serve <app-name>`.
3. Verify the application stays alive after the initial build and only
restarts when a file change is detected.

## Results
### BEFORE fix — 25 seconds of output:
```
[Nest] 91794  - started  08:45:13
[Nest] 91807  - started  08:45:13   ← restart #1, <1 second later
[Nest] 91820  - started  08:45:14   ← restart #2
[Nest] 91833  - started  08:45:14   ← restart #3
[Nest] 91846  - started  08:45:15   ← restart #4
... 20+ restarts, every ~1 second, with no file changes
```

### After fix 
```
[Nest] 92962  - started  08:45:53
                                    ← stays alive for the entire duration
                                    ← one PID, no restarts
                                    ← exited cleanly on timeout
```

## Related Issue(s)
Fixes nrwl#22945

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants