@element-hq/element-web-playwright-common 2.2.6 → 2.2.7

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.
package/Dockerfile CHANGED
@@ -6,6 +6,13 @@ WORKDIR /work
6
6
  # fonts-dejavu is needed for the same RTL rendering as on CI
7
7
  RUN apt-get update && apt-get -y install docker.io fonts-dejavu
8
8
 
9
+ # Set up corepack
10
+ RUN corepack enable
11
+ ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
12
+
13
+ # Add environment variable so consumers can skip developer-centric scripts
14
+ ENV PLAYWRIGHT_COMMON_DOCKER=1
15
+
9
16
  COPY docker-entrypoint.sh /docker-entrypoint.sh
10
17
 
11
18
  ENTRYPOINT ["/docker-entrypoint.sh"]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@element-hq/element-web-playwright-common",
3
3
  "type": "module",
4
- "version": "2.2.6",
4
+ "version": "2.2.7",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "repository": {
7
7
  "type": "git",
@@ -56,6 +56,7 @@ RUN_ARGS=(
56
56
  )
57
57
 
58
58
  DEFAULT_ARGS=(--grep @screenshot)
59
+ LINK_MODULES=true
59
60
 
60
61
  # Some arguments to customise behaviour so the same script / image can be
61
62
  # re-used for other screenshot generation.
@@ -72,6 +73,11 @@ while [[ $# -gt 0 ]]; do
72
73
  RUN_ARGS+=(--mount "${mount_param}" -e YARN_INSTALL=true)
73
74
  shift
74
75
  ;;
76
+ # Disables the automatic detection & linking of node_modules which can clash with developer tooling e.g. pnpm-link
77
+ --no-link-modules)
78
+ LINK_MODULES=false
79
+ shift
80
+ ;;
75
81
  # Sets a different entrypoint (in which case the default arguments to the script will be ignored)
76
82
  --entrypoint)
77
83
  shift
@@ -87,16 +93,17 @@ done
87
93
 
88
94
  build_image
89
95
 
90
- # Ensure we pass all symlinked node_modules to the container
91
- pushd node_modules > /dev/null
92
- SYMLINKS=$(find . -maxdepth 2 -type l -not -path "./.bin/*")
93
- popd > /dev/null
94
- for LINK in $SYMLINKS; do
95
- TARGET=$(readlink -f "node_modules/$LINK") || true
96
- if [ -d "$TARGET" ]; then
97
- if [ -n "$docker_is_podman" ]; then
98
- echo -e "\033[31m" >&2
99
- cat <<'EOF' >&2
96
+ if [[ $LINK_MODULES == true ]]; then
97
+ # Ensure we pass all symlinked node_modules to the container
98
+ pushd node_modules > /dev/null
99
+ SYMLINKS=$(find . -maxdepth 2 -type l -not -path "./.bin/*")
100
+ popd > /dev/null
101
+ for LINK in $SYMLINKS; do
102
+ TARGET=$(readlink -f "node_modules/$LINK") || true
103
+ if [ -d "$TARGET" ]; then
104
+ if [ -n "$docker_is_podman" ]; then
105
+ echo -e "\033[31m" >&2
106
+ cat <<'EOF' >&2
100
107
  WARNING: `node_modules` contains symlinks, and the support for this in
101
108
  `playwright-screenshots.sh` is broken under podman due to
102
109
  https://github.com/containers/podman/issues/25947.
@@ -104,12 +111,13 @@ https://github.com/containers/podman/issues/25947.
104
111
  If you get errors such as 'Error: crun: creating `<path>`', then retry this
105
112
  having `yarn unlink`ed the relevant node modules.
106
113
  EOF
107
- echo -e "\033[0m" >&2
114
+ echo -e "\033[0m" >&2
115
+ fi
116
+ echo "mounting linked package ${LINK:2} in container"
117
+ RUN_ARGS+=( "-v" "$TARGET:/work/node_modules/${LINK:2}" )
108
118
  fi
109
- echo "mounting linked package ${LINK:2} in container"
110
- RUN_ARGS+=( "-v" "$TARGET:/work/node_modules/${LINK:2}" )
111
- fi
112
- done
119
+ done
120
+ fi
113
121
 
114
122
  # Our Playwright fixtures use Testcontainers [1], which uses a docker image
115
123
  # called Ryuk [2], which will clean up any dangling containers/networks/etc