@shopify/cli-hydrogen 5.4.1 → 5.4.3

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.
@@ -151,7 +151,7 @@ export function SearchResults({
151
151
  function SearchResultsProductsGrid({products}: Pick<SearchQuery, 'products'>) {
152
152
  return (
153
153
  <div className="search-result">
154
- <h3>Products</h3>
154
+ <h2>Products</h2>
155
155
  <Pagination connection={products}>
156
156
  {({nodes, isLoading, NextLink, PreviousLink}) => {
157
157
  const itemsMarkup = nodes.map((product) => (
@@ -17,9 +17,14 @@ export async function loader({request, context, params}: LoaderArgs) {
17
17
 
18
18
  const url = new URL(request.url);
19
19
  const searchParams = new URLSearchParams(url.search);
20
- const redirectParam =
20
+ let redirectParam =
21
21
  searchParams.get('redirect') || searchParams.get('return_to') || '/';
22
22
 
23
+ if (redirectParam.includes('//')) {
24
+ // Avoid redirecting to external URLs to prevent phishing attacks
25
+ redirectParam = '/';
26
+ }
27
+
23
28
  searchParams.delete('redirect');
24
29
  searchParams.delete('return_to');
25
30
 
@@ -15,9 +15,9 @@
15
15
  "dependencies": {
16
16
  "@remix-run/react": "1.19.1",
17
17
  "@shopify/cli": "3.49.2",
18
- "@shopify/cli-hydrogen": "^5.4.1",
19
- "@shopify/hydrogen": "^2023.7.9",
20
- "@shopify/remix-oxygen": "^1.1.5",
18
+ "@shopify/cli-hydrogen": "^5.4.3",
19
+ "@shopify/hydrogen": "^2023.7.11",
20
+ "@shopify/remix-oxygen": "^1.1.7",
21
21
  "graphql": "^16.6.0",
22
22
  "graphql-tag": "^2.12.6",
23
23
  "isbot": "^3.6.6",
@@ -17,7 +17,6 @@ async function getRequestInfo(request) {
17
17
  endTime: data.endTime || Date.now(),
18
18
  purpose: data.purpose === "prefetch" ? "(prefetch)" : "",
19
19
  cacheStatus: data.cacheStatus ?? "",
20
- stackLine: data.stackLine ?? "",
21
20
  graphql: data.graphql ? JSON.parse(data.graphql) : null
22
21
  };
23
22
  }
@@ -32,16 +31,11 @@ async function logRequestEvent(request) {
32
31
  if (DEV_ROUTES.has(url.pathname)) {
33
32
  return new Response("ok");
34
33
  }
35
- const { eventType, purpose, stackLine, graphql, ...data } = await getRequestInfo(request);
36
- let originFile = "";
34
+ const { eventType, purpose, graphql, ...data } = await getRequestInfo(request);
37
35
  let graphiqlLink = "";
38
36
  let description = request.url;
39
37
  if (eventType === "subrequest") {
40
38
  description = graphql?.query.match(/(query|mutation)\s+(\w+)/)?.[0]?.replace(/\s+/, " ") || decodeURIComponent(url.search.slice(1));
41
- const [, fnName, filePath] = stackLine?.match(/\s+at ([^\s]+) \(.*?\/(app\/[^\n]*)\)/) || [];
42
- if (fnName && filePath) {
43
- originFile = `${fnName}:${filePath}`;
44
- }
45
39
  if (graphql) {
46
40
  graphiqlLink = getGraphiQLUrl({ graphql });
47
41
  }
@@ -51,8 +45,7 @@ async function logRequestEvent(request) {
51
45
  data: JSON.stringify({
52
46
  ...data,
53
47
  url: `${purpose} ${description}`.trim(),
54
- graphiqlLink,
55
- originFile
48
+ graphiqlLink
56
49
  })
57
50
  };
58
51
  eventHistory.push(event);
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.4.1",
2
+ "version": "5.4.3",
3
3
  "commands": {
4
4
  "hydrogen:build": {
5
5
  "id": "hydrogen:build",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "@shopify:registry": "https://registry.npmjs.org"
6
6
  },
7
- "version": "5.4.1",
7
+ "version": "5.4.3",
8
8
  "license": "MIT",
9
9
  "type": "module",
10
10
  "scripts": {
@@ -37,7 +37,7 @@
37
37
  "@oclif/core": "2.11.7",
38
38
  "@shopify/cli-kit": "3.49.2",
39
39
  "@shopify/hydrogen-codegen": "^0.0.2",
40
- "@shopify/mini-oxygen": "^2.2.1",
40
+ "@shopify/mini-oxygen": "^2.2.3",
41
41
  "@shopify/oxygen-cli": "^2.0.0",
42
42
  "ansi-escapes": "^6.2.0",
43
43
  "diff": "^5.1.0",
@@ -57,7 +57,7 @@
57
57
  "@remix-run/dev": "1.19.1",
58
58
  "@remix-run/react": "1.19.1",
59
59
  "@shopify/hydrogen-react": "^2023.7.4",
60
- "@shopify/remix-oxygen": "^1.1.5"
60
+ "@shopify/remix-oxygen": "^1.1.7"
61
61
  },
62
62
  "peerDependenciesMeta": {
63
63
  "@remix-run/dev": {