Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(webpack-dev-server): update the generated tsconfig path for angular CT #27723

Merged
merged 5 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ mainBuildFilters: &mainBuildFilters
- develop
- /^release\/\d+\.\d+\.\d+$/
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- 'update-v8-snapshot-cache-on-develop'
- 'publish-binary'
- 'cacie/chore/capture-metadata'
- 'jordanpowell88/update-angular-tsconfig-path'

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand All @@ -41,8 +40,7 @@ macWorkflowFilters: &darwin-workflow-filters
or:
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ cacie/chore/capture-metadata', << pipeline.git.branch >> ]
- equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -52,9 +50,8 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
or:
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ]
- equal: [ 'publish-binary', << pipeline.git.branch >> ]
- equal: [ cacie/chore/capture-metadata', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -73,8 +70,7 @@ windowsWorkflowFilters: &windows-workflow-filters
or:
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ cacie/chore/capture-metadata', << pipeline.git.branch >> ]
- equal: [ 'jordanpowell88/update-angular-tsconfig-path', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -144,7 +140,7 @@ commands:
name: Set environment variable to determine whether or not to persist artifacts
command: |
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
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
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
export SHOULD_PERSIST_ARTIFACTS=true
fi' >> "$BASH_ENV"
# You must run `setup_should_persist_artifacts` command and be using bash before running this command
Expand Down
8 changes: 8 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.2.0

_Released 09/12/2023 (PENDING)_

**Features:**

- Adds support for Nx users who want to run Angular Component Testing in parallel. Addresses [#27723](https://github.com/cypress-io/cypress/pull/27723).

## 13.1.0

_Released 08/31/2023_
Expand Down
6 changes: 3 additions & 3 deletions npm/webpack-dev-server/src/helpers/angularHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ export async function generateTsConfig (devServerConfig: AngularWebpackDevServer
include: includePaths,
}, null, 2)

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

await fs.writeFile(tsConfigPath, tsConfigContent)

return tsConfigPath
}

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

await fs.ensureDir(cypressTempDir)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const expectLoadsAngularBuildOptions = (buildOptions: BuildOptions) => {
const expectGeneratesTsConfig = async (devServerConfig: AngularWebpackDevServerConfig, buildOptions: any) => {
const { projectRoot } = devServerConfig.cypressConfig
let tsConfigPath = await generateTsConfig(devServerConfig, buildOptions)
const tempDir = await getTempDir()
const tempDir = await getTempDir(path.basename(projectRoot))

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

Expand Down
Loading