Skip to content

Commit 264a118

Browse files
feat(webpack-dev-server): update the generated tsconfig path for angular CT (#27723)
* feat(webpack-dev-server): update the generated tsconfig path for angular CT * update changelog * build binary * fix broken tests
1 parent 07b1c3b commit 264a118

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

.circleci/workflows.yml

+5-9
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ mainBuildFilters: &mainBuildFilters
2929
- develop
3030
- /^release\/\d+\.\d+\.\d+$/
3131
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
32-
- 'update-v8-snapshot-cache-on-develop'
3332
- 'publish-binary'
34-
- 'cacie/chore/capture-metadata'
33+
- 'jordanpowell88/update-angular-tsconfig-path'
3534

3635
# usually we don't build Mac app - it takes a long time
3736
# but sometimes we want to really confirm we are doing the right thing
@@ -41,8 +40,7 @@ macWorkflowFilters: &darwin-workflow-filters
4140
or:
4241
- equal: [ develop, << pipeline.git.branch >> ]
4342
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
44-
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
45-
- equal: [ cacie/chore/capture-metadata', << pipeline.git.branch >> ]
43+
- equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ]
4644
- matches:
4745
pattern: /^release\/\d+\.\d+\.\d+$/
4846
value: << pipeline.git.branch >>
@@ -52,9 +50,8 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
5250
or:
5351
- equal: [ develop, << pipeline.git.branch >> ]
5452
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
55-
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
53+
- equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ]
5654
- equal: [ 'publish-binary', << pipeline.git.branch >> ]
57-
- equal: [ cacie/chore/capture-metadata', << pipeline.git.branch >> ]
5855
- matches:
5956
pattern: /^release\/\d+\.\d+\.\d+$/
6057
value: << pipeline.git.branch >>
@@ -73,8 +70,7 @@ windowsWorkflowFilters: &windows-workflow-filters
7370
or:
7471
- equal: [ develop, << pipeline.git.branch >> ]
7572
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
76-
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
77-
- equal: [ cacie/chore/capture-metadata', << pipeline.git.branch >> ]
73+
- equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ]
7874
- matches:
7975
pattern: /^release\/\d+\.\d+\.\d+$/
8076
value: << pipeline.git.branch >>
@@ -144,7 +140,7 @@ commands:
144140
name: Set environment variable to determine whether or not to persist artifacts
145141
command: |
146142
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
147-
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "publish-binary" && "$CIRCLE_BRANCH" != "update-v8-snapshot-cache-on-develop" && "$CIRCLE_BRANCH" != "ryanm/feat/handle-304s" ]]; then
143+
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "publish-binary" && "$CIRCLE_BRANCH" != "jordanpowell88/update-angular-tsconfig-path" && "$CIRCLE_BRANCH" != "ryanm/feat/handle-304s" ]]; then
148144
export SHOULD_PERSIST_ARTIFACTS=true
149145
fi' >> "$BASH_ENV"
150146
# You must run `setup_should_persist_artifacts` command and be using bash before running this command

cli/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
2+
## 13.2.0
3+
4+
_Released 09/12/2023 (PENDING)_
5+
6+
**Features:**
7+
8+
- Adds support for Nx users who want to run Angular Component Testing in parallel. Addresses [#27723](https://github.com/cypress-io/cypress/pull/27723).
9+
210
## 13.1.0
311

412
_Released 08/31/2023_

npm/webpack-dev-server/src/helpers/angularHandler.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ export async function generateTsConfig (devServerConfig: AngularWebpackDevServer
154154
include: includePaths,
155155
}, null, 2)
156156

157-
const tsConfigPath = path.join(await getTempDir(), 'tsconfig.json')
157+
const tsConfigPath = path.join(await getTempDir(path.basename(projectRoot)), 'tsconfig.json')
158158

159159
await fs.writeFile(tsConfigPath, tsConfigContent)
160160

161161
return tsConfigPath
162162
}
163163

164-
export async function getTempDir (): Promise<string> {
165-
const cypressTempDir = path.join(tmpdir(), 'cypress-angular-ct')
164+
export async function getTempDir (projectName: string): Promise<string> {
165+
const cypressTempDir = path.join(tmpdir(), 'cypress-angular-ct', projectName)
166166

167167
await fs.ensureDir(cypressTempDir)
168168

npm/webpack-dev-server/test/handlers/angularHandler.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const expectLoadsAngularBuildOptions = (buildOptions: BuildOptions) => {
194194
const expectGeneratesTsConfig = async (devServerConfig: AngularWebpackDevServerConfig, buildOptions: any) => {
195195
const { projectRoot } = devServerConfig.cypressConfig
196196
let tsConfigPath = await generateTsConfig(devServerConfig, buildOptions)
197-
const tempDir = await getTempDir()
197+
const tempDir = await getTempDir(path.basename(projectRoot))
198198

199199
expect(tsConfigPath).to.eq(path.join(tempDir, 'tsconfig.json'))
200200

0 commit comments

Comments
 (0)