@shopify/create-hydrogen 5.0.15 → 5.0.16

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.
Files changed (42) hide show
  1. package/dist/assets/hydrogen/starter/CHANGELOG.md +206 -0
  2. package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +1 -1
  3. package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +17 -6
  4. package/dist/assets/hydrogen/starter/app/entry.server.tsx +2 -3
  5. package/dist/assets/hydrogen/starter/app/root.tsx +9 -5
  6. package/dist/assets/hydrogen/starter/app/routes/[robots.txt].tsx +0 -1
  7. package/dist/assets/hydrogen/starter/app/routes/_index.tsx +2 -2
  8. package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +17 -17
  9. package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +3 -3
  10. package/dist/assets/hydrogen/starter/app/routes/account.orders._index.tsx +2 -2
  11. package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +6 -6
  12. package/dist/assets/hydrogen/starter/app/routes/account.tsx +2 -2
  13. package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle.$articleHandle.tsx +2 -2
  14. package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +2 -2
  15. package/dist/assets/hydrogen/starter/app/routes/blogs._index.tsx +2 -2
  16. package/dist/assets/hydrogen/starter/app/routes/cart.tsx +5 -3
  17. package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +2 -2
  18. package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +2 -2
  19. package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +2 -2
  20. package/dist/assets/hydrogen/starter/app/routes/pages.$handle.tsx +2 -2
  21. package/dist/assets/hydrogen/starter/app/routes/policies.$handle.tsx +2 -2
  22. package/dist/assets/hydrogen/starter/app/routes/policies._index.tsx +2 -2
  23. package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +2 -2
  24. package/dist/assets/hydrogen/starter/app/routes/search.tsx +1 -2
  25. package/dist/assets/hydrogen/starter/eslint.config.js +261 -0
  26. package/dist/assets/hydrogen/starter/guides/predictiveSearch/predictiveSearch.md +3 -3
  27. package/dist/assets/hydrogen/starter/guides/search/search.md +3 -3
  28. package/dist/assets/hydrogen/starter/package.json +24 -12
  29. package/dist/assets/hydrogen/starter/server.ts +3 -2
  30. package/dist/assets/hydrogen/starter/tsconfig.json +5 -1
  31. package/dist/assets/hydrogen/starter/vite.config.ts +7 -0
  32. package/dist/assets/hydrogen/vite/package.json +1 -1
  33. package/dist/assets/hydrogen/vite/vite.config.js +0 -1
  34. package/dist/chunk-ULLCPMX6.js +3 -0
  35. package/dist/{chunk-QOJXU774.js → chunk-XXYZHDBL.js} +384 -384
  36. package/dist/create-app.js +795 -1003
  37. package/dist/{del-KPQQ4LCD.js → del-G73TN4QI.js} +1 -1
  38. package/dist/{error-handler-GXLCBIP5.js → error-handler-XEHYQ43T.js} +1 -1
  39. package/package.json +1 -1
  40. package/dist/assets/hydrogen/starter/.eslintignore +0 -5
  41. package/dist/assets/hydrogen/starter/.eslintrc.cjs +0 -19
  42. package/dist/chunk-3657J2ZN.js +0 -3
@@ -1,4 +1,4 @@
1
- import {defer, redirect, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
1
+ import {redirect, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
2
  import {useLoaderData, Link, type MetaFunction} from '@remix-run/react';
3
3
  import {
4
4
  getPaginationVariables,
@@ -21,7 +21,7 @@ export async function loader(args: LoaderFunctionArgs) {
21
21
  // Await the critical data required to render initial state of the page
22
22
  const criticalData = await loadCriticalData(args);
23
23
 
24
- return defer({...deferredData, ...criticalData});
24
+ return {...deferredData, ...criticalData};
25
25
  }
26
26
 
27
27
  /**
@@ -1,5 +1,5 @@
1
1
  import {useLoaderData, Link} from '@remix-run/react';
2
- import {defer, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
+ import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
3
3
  import {getPaginationVariables, Image} from '@shopify/hydrogen';
4
4
  import type {CollectionFragment} from 'storefrontapi.generated';
5
5
  import {PaginatedResourceSection} from '~/components/PaginatedResourceSection';
@@ -11,7 +11,7 @@ export async function loader(args: LoaderFunctionArgs) {
11
11
  // Await the critical data required to render initial state of the page
12
12
  const criticalData = await loadCriticalData(args);
13
13
 
14
- return defer({...deferredData, ...criticalData});
14
+ return {...deferredData, ...criticalData};
15
15
  }
16
16
 
17
17
  /**
@@ -1,4 +1,4 @@
1
- import {defer, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
1
+ import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
2
  import {useLoaderData, Link, type MetaFunction} from '@remix-run/react';
3
3
  import {getPaginationVariables, Image, Money} from '@shopify/hydrogen';
4
4
  import type {ProductItemFragment} from 'storefrontapi.generated';
@@ -16,7 +16,7 @@ export async function loader(args: LoaderFunctionArgs) {
16
16
  // Await the critical data required to render initial state of the page
17
17
  const criticalData = await loadCriticalData(args);
18
18
 
19
- return defer({...deferredData, ...criticalData});
19
+ return {...deferredData, ...criticalData};
20
20
  }
21
21
 
22
22
  /**
@@ -1,4 +1,4 @@
1
- import {defer, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
1
+ import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
2
  import {useLoaderData, type MetaFunction} from '@remix-run/react';
3
3
 
4
4
  export const meta: MetaFunction<typeof loader> = ({data}) => {
@@ -12,7 +12,7 @@ export async function loader(args: LoaderFunctionArgs) {
12
12
  // Await the critical data required to render initial state of the page
13
13
  const criticalData = await loadCriticalData(args);
14
14
 
15
- return defer({...deferredData, ...criticalData});
15
+ return {...deferredData, ...criticalData};
16
16
  }
17
17
 
18
18
  /**
@@ -1,4 +1,4 @@
1
- import {json, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
1
+ import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
2
  import {Link, useLoaderData, type MetaFunction} from '@remix-run/react';
3
3
  import {type Shop} from '@shopify/hydrogen/storefront-api-types';
4
4
 
@@ -38,7 +38,7 @@ export async function loader({params, context}: LoaderFunctionArgs) {
38
38
  throw new Response('Could not find the policy', {status: 404});
39
39
  }
40
40
 
41
- return json({policy});
41
+ return {policy};
42
42
  }
43
43
 
44
44
  export default function Policy() {
@@ -1,4 +1,4 @@
1
- import {json, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
1
+ import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
2
  import {useLoaderData, Link} from '@remix-run/react';
3
3
 
4
4
  export async function loader({context}: LoaderFunctionArgs) {
@@ -9,7 +9,7 @@ export async function loader({context}: LoaderFunctionArgs) {
9
9
  throw new Response('No policies found', {status: 404});
10
10
  }
11
11
 
12
- return json({policies});
12
+ return {policies};
13
13
  }
14
14
 
15
15
  export default function Policies() {
@@ -1,4 +1,4 @@
1
- import {defer, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
1
+ import {type LoaderFunctionArgs} from '@shopify/remix-oxygen';
2
2
  import {useLoaderData, type MetaFunction} from '@remix-run/react';
3
3
  import {
4
4
  getSelectedProductOptions,
@@ -29,7 +29,7 @@ export async function loader(args: LoaderFunctionArgs) {
29
29
  // Await the critical data required to render initial state of the page
30
30
  const criticalData = await loadCriticalData(args);
31
31
 
32
- return defer({...deferredData, ...criticalData});
32
+ return {...deferredData, ...criticalData};
33
33
  }
34
34
 
35
35
  /**
@@ -1,5 +1,4 @@
1
1
  import {
2
- json,
3
2
  type LoaderFunctionArgs,
4
3
  type ActionFunctionArgs,
5
4
  } from '@shopify/remix-oxygen';
@@ -29,7 +28,7 @@ export async function loader({request, context}: LoaderFunctionArgs) {
29
28
  return {term: '', result: null, error: error.message};
30
29
  });
31
30
 
32
- return json(await searchPromise);
31
+ return await searchPromise;
33
32
  }
34
33
 
35
34
  /**
@@ -0,0 +1,261 @@
1
+ import {fixupConfigRules, fixupPluginRules} from '@eslint/compat';
2
+ import eslintComments from 'eslint-plugin-eslint-comments';
3
+ import react from 'eslint-plugin-react';
4
+ import reactHooks from 'eslint-plugin-react-hooks';
5
+ import jsxA11Y from 'eslint-plugin-jsx-a11y';
6
+ import globals from 'globals';
7
+ import typescriptEslint from '@typescript-eslint/eslint-plugin';
8
+ import _import from 'eslint-plugin-import';
9
+ import tsParser from '@typescript-eslint/parser';
10
+ import jest from 'eslint-plugin-jest';
11
+ import path from 'node:path';
12
+ import {fileURLToPath} from 'node:url';
13
+ import js from '@eslint/js';
14
+ import {FlatCompat} from '@eslint/eslintrc';
15
+
16
+ const __filename = fileURLToPath(import.meta.url);
17
+ const __dirname = path.dirname(__filename);
18
+ const compat = new FlatCompat({
19
+ baseDirectory: __dirname,
20
+ recommendedConfig: js.configs.recommended,
21
+ allConfig: js.configs.all,
22
+ });
23
+
24
+ export default [
25
+ {
26
+ ignores: [
27
+ '**/node_modules/',
28
+ '**/build/',
29
+ '**/*.graphql.d.ts',
30
+ '**/*.graphql.ts',
31
+ '**/*.generated.d.ts',
32
+ ],
33
+ },
34
+ ...fixupConfigRules(
35
+ compat.extends(
36
+ 'eslint:recommended',
37
+ 'plugin:eslint-comments/recommended',
38
+ 'plugin:react/recommended',
39
+ 'plugin:react-hooks/recommended',
40
+ 'plugin:jsx-a11y/recommended',
41
+ ),
42
+ ),
43
+ {
44
+ plugins: {
45
+ 'eslint-comments': fixupPluginRules(eslintComments),
46
+ react: fixupPluginRules(react),
47
+ 'react-hooks': fixupPluginRules(reactHooks),
48
+ 'jsx-a11y': fixupPluginRules(jsxA11Y),
49
+ },
50
+ languageOptions: {
51
+ globals: {
52
+ ...globals.browser,
53
+ ...globals.node,
54
+ },
55
+ ecmaVersion: 'latest',
56
+ sourceType: 'module',
57
+ parserOptions: {
58
+ ecmaFeatures: {
59
+ jsx: true,
60
+ },
61
+ },
62
+ },
63
+ settings: {
64
+ react: {
65
+ version: 'detect',
66
+ },
67
+ },
68
+ rules: {
69
+ 'eslint-comments/no-unused-disable': 'error',
70
+ 'no-console': [
71
+ 'warn',
72
+ {
73
+ allow: ['warn', 'error'],
74
+ },
75
+ ],
76
+ 'no-use-before-define': 'off',
77
+ 'no-warning-comments': 'off',
78
+ 'object-shorthand': [
79
+ 'error',
80
+ 'always',
81
+ {
82
+ avoidQuotes: true,
83
+ },
84
+ ],
85
+ 'no-useless-escape': 'off',
86
+ 'no-case-declarations': 'off',
87
+ },
88
+ },
89
+ ...fixupConfigRules(
90
+ compat.extends(
91
+ 'plugin:react/recommended',
92
+ 'plugin:react/jsx-runtime',
93
+ 'plugin:react-hooks/recommended',
94
+ 'plugin:jsx-a11y/recommended',
95
+ ),
96
+ ).map((config) => ({
97
+ ...config,
98
+ files: ['**/*.{js,jsx,ts,tsx}'],
99
+ })),
100
+ {
101
+ files: ['**/*.{js,jsx,ts,tsx}'],
102
+ plugins: {
103
+ react: fixupPluginRules(react),
104
+ 'jsx-a11y': fixupPluginRules(jsxA11Y),
105
+ },
106
+ settings: {
107
+ react: {
108
+ version: 'detect',
109
+ },
110
+ formComponents: ['Form'],
111
+ linkComponents: [
112
+ {
113
+ name: 'Link',
114
+ linkAttribute: 'to',
115
+ },
116
+ {
117
+ name: 'NavLink',
118
+ linkAttribute: 'to',
119
+ },
120
+ ],
121
+ 'import/resolver': {
122
+ typescript: {},
123
+ },
124
+ },
125
+ rules: {
126
+ 'jsx-a11y/control-has-associated-label': 'off',
127
+ 'jsx-a11y/label-has-for': 'off',
128
+ 'react/display-name': 'off',
129
+ 'react/no-array-index-key': 'warn',
130
+ 'react/prop-types': 'off',
131
+ 'react/react-in-jsx-scope': 'off',
132
+ },
133
+ },
134
+ ...fixupConfigRules(
135
+ compat.extends(
136
+ 'plugin:@typescript-eslint/recommended',
137
+ 'plugin:import/recommended',
138
+ 'plugin:import/typescript',
139
+ ),
140
+ ).map((config) => ({
141
+ ...config,
142
+ files: ['**/*.{ts,tsx}'],
143
+ })),
144
+ {
145
+ files: ['**/*.{ts,tsx}'],
146
+ plugins: {
147
+ '@typescript-eslint': fixupPluginRules(typescriptEslint),
148
+ import: fixupPluginRules(_import),
149
+ },
150
+ languageOptions: {
151
+ parser: tsParser,
152
+ parserOptions: {
153
+ projectService: {
154
+ allowDefaultProject: ['.graphqlrc.ts'],
155
+ },
156
+ tsconfigRootDir: __dirname,
157
+ ecmaFeatures: {
158
+ jsx: true,
159
+ },
160
+ },
161
+ },
162
+ settings: {
163
+ 'import/internal-regex': '^~/',
164
+ 'import/resolvers': {
165
+ node: {
166
+ extensions: ['.ts', '.tsx'],
167
+ },
168
+ typescript: {
169
+ alwaysTryTypes: true,
170
+ project: __dirname,
171
+ },
172
+ },
173
+ },
174
+ rules: {
175
+ '@typescript-eslint/ban-ts-comment': 'off',
176
+ '@typescript-eslint/naming-convention': 'off',
177
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
178
+ },
179
+ },
180
+ {
181
+ files: ['**/.eslintrc.cjs'],
182
+ languageOptions: {
183
+ globals: {
184
+ ...globals.node,
185
+ },
186
+ },
187
+ },
188
+ ...compat.extends('plugin:jest/recommended').map((config) => ({
189
+ ...config,
190
+ files: ['**/*.test.*'],
191
+ })),
192
+ {
193
+ files: ['**/*.test.*'],
194
+ plugins: {
195
+ jest,
196
+ },
197
+ languageOptions: {
198
+ globals: {
199
+ ...globals.node,
200
+ ...globals.jest,
201
+ },
202
+ },
203
+ },
204
+ {
205
+ files: ['**/*.server.*'],
206
+ rules: {
207
+ 'react-hooks/rules-of-hooks': 'off',
208
+ },
209
+ },
210
+ ...fixupConfigRules(
211
+ compat.extends(
212
+ 'plugin:@typescript-eslint/eslint-recommended',
213
+ 'plugin:@typescript-eslint/recommended',
214
+ ),
215
+ ).map((config) => ({
216
+ ...config,
217
+ files: ['**/*.ts', '**/*.tsx'],
218
+ })),
219
+ {
220
+ files: ['**/*.ts', '**/*.tsx'],
221
+ languageOptions: {
222
+ parser: tsParser,
223
+ },
224
+ rules: {
225
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
226
+ '@typescript-eslint/naming-convention': [
227
+ 'error',
228
+ {
229
+ selector: 'default',
230
+ format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
231
+ leadingUnderscore: 'allowSingleOrDouble',
232
+ trailingUnderscore: 'allowSingleOrDouble',
233
+ },
234
+ {
235
+ selector: 'typeLike',
236
+ format: ['PascalCase'],
237
+ },
238
+ {
239
+ selector: 'typeParameter',
240
+ format: ['PascalCase'],
241
+ leadingUnderscore: 'allow',
242
+ },
243
+ {
244
+ selector: 'interface',
245
+ format: ['PascalCase'],
246
+ },
247
+ {
248
+ selector: 'property',
249
+ format: null,
250
+ },
251
+ ],
252
+ '@typescript-eslint/no-empty-function': 'off',
253
+ '@typescript-eslint/no-empty-interface': 'off',
254
+ '@typescript-eslint/no-empty-object-type': 'off',
255
+ '@typescript-eslint/no-explicit-any': 'off',
256
+ '@typescript-eslint/no-non-null-assertion': 'off',
257
+ '@typescript-eslint/no-unused-vars': 'off',
258
+ 'react/prop-types': 'off',
259
+ },
260
+ },
261
+ ];
@@ -194,7 +194,7 @@ async function predictiveSearch({
194
194
 
195
195
  const total = Object.values(items).reduce((acc, {length}) => acc + length, 0);
196
196
 
197
- return json({term, result: {items, total}, error: null});
197
+ return {term, result: {items, total}, error: null};
198
198
  }
199
199
  ```
200
200
 
@@ -217,7 +217,7 @@ export async function loader({request, context}: LoaderFunctionArgs) {
217
217
  const isPredictive = url.searchParams.has('predictive');
218
218
 
219
219
  if (!isPredictive) {
220
- return json({})
220
+ return {}
221
221
  }
222
222
 
223
223
  const searchPromise = predictiveSearch({request, context})
@@ -227,7 +227,7 @@ export async function loader({request, context}: LoaderFunctionArgs) {
227
227
  return {term: '', result: null, error: error.message};
228
228
  });
229
229
 
230
- return json(await searchPromise);
230
+ return await searchPromise;
231
231
  }
232
232
  ```
233
233
 
@@ -191,7 +191,7 @@ async function search({
191
191
  return acc + nodes.length;
192
192
  }, 0);
193
193
 
194
- return json({term, result: {total, items}});
194
+ return {term, result: {total, items}};
195
195
  }
196
196
  ```
197
197
 
@@ -212,7 +212,7 @@ export async function loader({request, context}: LoaderFunctionArgs) {
212
212
  const isRegular = !url.searchParams.has('predictive');
213
213
 
214
214
  if (!isRegular) {
215
- return json({})
215
+ return {}
216
216
  }
217
217
 
218
218
  const searchPromise = regularSearch({request, context});
@@ -222,7 +222,7 @@ export async function loader({request, context}: LoaderFunctionArgs) {
222
222
  return {term: '', result: null, error: error.message};
223
223
  });
224
224
 
225
- return json(await searchPromise);
225
+ return await searchPromise;
226
226
  }
227
227
  ```
228
228
 
@@ -2,43 +2,55 @@
2
2
  "name": "skeleton",
3
3
  "private": true,
4
4
  "sideEffects": false,
5
- "version": "2025.1.0",
5
+ "version": "2025.1.1",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "build": "shopify hydrogen build --codegen",
9
9
  "dev": "shopify hydrogen dev --codegen",
10
10
  "preview": "shopify hydrogen preview --build",
11
- "lint": "eslint --no-error-on-unmatched-pattern --ext .js,.ts,.jsx,.tsx .",
11
+ "lint": "eslint --no-error-on-unmatched-pattern .",
12
12
  "typecheck": "tsc --noEmit",
13
13
  "codegen": "shopify hydrogen codegen"
14
14
  },
15
15
  "prettier": "@shopify/prettier-config",
16
16
  "dependencies": {
17
- "@remix-run/react": "^2.15.2",
18
- "@remix-run/server-runtime": "^2.15.2",
19
- "@shopify/hydrogen": "2025.1.0",
20
- "@shopify/remix-oxygen": "^2.0.10",
17
+ "@remix-run/react": "^2.15.3",
18
+ "@remix-run/server-runtime": "^2.15.3",
19
+ "@shopify/hydrogen": "2025.1.1",
20
+ "@shopify/remix-oxygen": "^2.0.11",
21
21
  "graphql": "^16.6.0",
22
22
  "graphql-tag": "^2.12.6",
23
- "isbot": "^3.8.0",
23
+ "isbot": "^5.1.21",
24
24
  "react": "^18.2.0",
25
25
  "react-dom": "^18.2.0"
26
26
  },
27
27
  "devDependencies": {
28
+ "@eslint/compat": "^1.2.5",
29
+ "@eslint/eslintrc": "^3.2.0",
30
+ "@eslint/js": "^9.18.0",
28
31
  "@graphql-codegen/cli": "5.0.2",
29
- "@remix-run/dev": "^2.15.2",
30
- "@remix-run/eslint-config": "^2.15.2",
32
+ "@remix-run/dev": "^2.15.3",
31
33
  "@shopify/cli": "~3.74.1",
32
34
  "@shopify/hydrogen-codegen": "^0.3.2",
33
35
  "@shopify/mini-oxygen": "^3.1.1",
34
36
  "@shopify/oxygen-workers-types": "^4.1.2",
35
37
  "@shopify/prettier-config": "^1.1.2",
36
38
  "@total-typescript/ts-reset": "^0.4.2",
37
- "@types/eslint": "^8.4.10",
39
+ "@types/eslint": "^9.6.1",
38
40
  "@types/react": "^18.2.22",
39
41
  "@types/react-dom": "^18.2.7",
40
- "eslint": "^8.20.0",
41
- "eslint-plugin-hydrogen": "0.12.2",
42
+ "@typescript-eslint/eslint-plugin": "^8.21.0",
43
+ "@typescript-eslint/parser": "^8.21.0",
44
+ "eslint": "^9.18.0",
45
+ "eslint-config-prettier": "^10.0.1",
46
+ "eslint-import-resolver-typescript": "^3.7.0",
47
+ "eslint-plugin-eslint-comments": "^3.2.0",
48
+ "eslint-plugin-import": "^2.31.0",
49
+ "eslint-plugin-jest": "^28.11.0",
50
+ "eslint-plugin-jsx-a11y": "^6.10.2",
51
+ "eslint-plugin-react": "^7.37.4",
52
+ "eslint-plugin-react-hooks": "^5.1.0",
53
+ "globals": "^15.14.0",
42
54
  "prettier": "^2.8.4",
43
55
  "typescript": "^5.2.2",
44
56
  "vite": "^5.1.8",
@@ -1,5 +1,7 @@
1
- // @ts-ignore
2
1
  // Virtual entry point for the app
2
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3
+ // @ts-ignore
4
+ // eslint-disable-next-line import/no-unresolved
3
5
  import * as remixBuild from 'virtual:remix/server-build';
4
6
  import {storefrontRedirect} from '@shopify/hydrogen';
5
7
  import {createRequestHandler} from '@shopify/remix-oxygen';
@@ -55,7 +57,6 @@ export default {
55
57
 
56
58
  return response;
57
59
  } catch (error) {
58
- // eslint-disable-next-line no-console
59
60
  console.error(error);
60
61
  return new Response('An unexpected error occurred', {status: 500});
61
62
  }
@@ -14,7 +14,11 @@
14
14
  "forceConsistentCasingInFileNames": true,
15
15
  "skipLibCheck": true,
16
16
  "baseUrl": ".",
17
- "types": ["@shopify/oxygen-workers-types", "@remix-run/node", "vite/client"],
17
+ "types": [
18
+ "@shopify/oxygen-workers-types",
19
+ "@remix-run/node",
20
+ "vite/client"
21
+ ],
18
22
  "paths": {
19
23
  "~/*": ["app/*"]
20
24
  },
@@ -4,6 +4,12 @@ import {oxygen} from '@shopify/mini-oxygen/vite';
4
4
  import {vitePlugin as remix} from '@remix-run/dev';
5
5
  import tsconfigPaths from 'vite-tsconfig-paths';
6
6
 
7
+ declare module "@remix-run/server-runtime" {
8
+ interface Future {
9
+ v3_singleFetch: true;
10
+ }
11
+ }
12
+
7
13
  export default defineConfig({
8
14
  plugins: [
9
15
  hydrogen(),
@@ -15,6 +21,7 @@ export default defineConfig({
15
21
  v3_relativeSplatPath: true,
16
22
  v3_throwAbortReason: true,
17
23
  v3_lazyRouteDiscovery: true,
24
+ v3_singleFetch: true,
18
25
  },
19
26
  }),
20
27
  tsconfigPaths(),
@@ -5,7 +5,7 @@
5
5
  "dev": "shopify hydrogen dev --codegen"
6
6
  },
7
7
  "dependencies": {
8
- "isbot": "^3.8.0"
8
+ "isbot": "^5.1.21"
9
9
  },
10
10
  "devDependencies": {
11
11
  "vite": "^5.1.8",
@@ -14,7 +14,6 @@ export default defineConfig({
14
14
  v3_fetcherPersist: true,
15
15
  v3_relativeSplatPath: true,
16
16
  v3_throwAbortReason: true,
17
- v3_lazyRouteDiscovery: true,
18
17
  },
19
18
  }),
20
19
  tsconfigPaths(),
@@ -0,0 +1,3 @@
1
+ import { createRequire as __createRequire } from 'module';globalThis.require = __createRequire(import.meta.url);
2
+ import{a as bt,b as Fe}from"./chunk-2RCBZ7OV.js";import{a as I,c as N,i as h}from"./chunk-MNT4XW23.js";var Pe=N((Sr,Te)=>{"use strict";h();Te.exports=e=>{let t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}});var $e=N((vr,Re)=>{"use strict";h();Re.exports=(...e)=>[...new Set([].concat(...e))]});var Le=N(q=>{"use strict";h();var{promisify:xt}=I("util"),Ae=I("fs");async function ie(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await xt(Ae[e])(r))[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function oe(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return Ae[e](r)[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}q.isFile=ie.bind(null,"stat","isFile");q.isDirectory=ie.bind(null,"stat","isDirectory");q.isSymlink=ie.bind(null,"lstat","isSymbolicLink");q.isFileSync=oe.bind(null,"statSync","isFile");q.isDirectorySync=oe.bind(null,"statSync","isDirectory");q.isSymlinkSync=oe.bind(null,"lstatSync","isSymbolicLink")});var Ge=N((Fr,ce)=>{"use strict";h();var M=I("path"),Ne=Le(),De=e=>e.length>1?`{${e.join(",")}}`:e[0],Ie=(e,t)=>{let r=e[0]==="!"?e.slice(1):e;return M.isAbsolute(r)?r:M.join(t,r)},Ot=(e,t)=>M.extname(e)?`**/${e}`:`**/${e}.${De(t)}`,je=(e,t)=>{if(t.files&&!Array.isArray(t.files))throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof t.files}\``);if(t.extensions&&!Array.isArray(t.extensions))throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof t.extensions}\``);return t.files&&t.extensions?t.files.map(r=>M.posix.join(e,Ot(r,t.extensions))):t.files?t.files.map(r=>M.posix.join(e,`**/${r}`)):t.extensions?[M.posix.join(e,`**/*.${De(t.extensions)}`)]:[M.posix.join(e,"**")]};ce.exports=async(e,t)=>{if(t={cwd:process.cwd(),...t},typeof t.cwd!="string")throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof t.cwd}\``);let r=await Promise.all([].concat(e).map(async n=>await Ne.isDirectory(Ie(n,t.cwd))?je(n,t):n));return[].concat.apply([],r)};ce.exports.sync=(e,t)=>{if(t={cwd:process.cwd(),...t},typeof t.cwd!="string")throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof t.cwd}\``);let r=[].concat(e).map(n=>Ne.isDirectorySync(Ie(n,t.cwd))?je(n,t):n);return[].concat.apply([],r)}});var Ue=N((Pr,Ke)=>{"use strict";h();function Ce(e){return Array.isArray(e)?e:[e]}var ue="",qe=" ",se="\\",Ft=/^\s+$/,Tt=/(?:[^\\]|^)\\$/,Pt=/^\\!/,Rt=/^\\#/,$t=/\r?\n/g,At=/^\.*\/|^\.+$/,ae="/",ke="node-ignore";typeof Symbol<"u"&&(ke=Symbol.for("node-ignore"));var Me=ke,Lt=(e,t,r)=>Object.defineProperty(e,t,{value:r}),Nt=/([0-z])-([0-z])/g,Ye=()=>!1,Dt=e=>e.replace(Nt,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:ue),It=e=>{let{length:t}=e;return e.slice(0,t-t%2)},jt=[[/^\uFEFF/,()=>ue],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?qe:ue)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+qe}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>se],[/\\\\/g,()=>se],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===se?`\\[${r}${It(n)}${o}`:o==="]"&&n.length%2===0?`[${Dt(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],We=Object.create(null),Gt=(e,t)=>{let r=We[e];return r||(r=jt.reduce((n,[o,s])=>n.replace(o,s.bind(e)),e),We[e]=r),t?new RegExp(r,"i"):new RegExp(r)},de=e=>typeof e=="string",Ct=e=>e&&de(e)&&!Ft.test(e)&&!Tt.test(e)&&e.indexOf("#")!==0,qt=e=>e.split($t),le=class{constructor(t,r,n,o){this.origin=t,this.pattern=r,this.negative=n,this.regex=o}},Mt=(e,t)=>{let r=e,n=!1;e.indexOf("!")===0&&(n=!0,e=e.substr(1)),e=e.replace(Pt,"!").replace(Rt,"#");let o=Gt(e,t);return new le(r,e,n,o)},Wt=(e,t)=>{throw new t(e)},j=(e,t,r)=>de(e)?e?j.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),Xe=e=>At.test(e);j.isNotRelative=Xe;j.convert=e=>e;var fe=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){Lt(this,Me,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[Me]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(Ct(t)){let r=Mt(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,Ce(de(t)?qt(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,r){let n=!1,o=!1;return this._rules.forEach(s=>{let{negative:d}=s;if(o===d&&n!==o||d&&!n&&!o&&!r)return;s.regex.test(t)&&(n=!d,o=d)}),{ignored:n,unignored:o}}_test(t,r,n,o){let s=t&&j.convert(t);return j(s,t,this._allowRelativePaths?Ye:Wt),this._t(s,r,n,o)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(ae)),o.pop(),!o.length)return r[t]=this._testOne(t,n);let s=this._t(o.join(ae)+ae,r,n,o);return r[t]=s.ignored?s:this._testOne(t,n)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return Ce(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},U=e=>new fe(e),kt=e=>j(e&&j.convert(e),e,Ye);U.isPathValid=kt;U.default=U;Ke.exports=U;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");j.convert=e;let t=/^[a-z]:\//i;j.isNotRelative=r=>t.test(r)||Xe(r)}});var Ze=N(($r,pe)=>{"use strict";h();var{promisify:Yt}=I("util"),Be=I("fs"),G=I("path"),ze=Fe(),Xt=Ue(),K=Pe(),He=["**/node_modules/**","**/flow-typed/**","**/coverage/**","**/.git"],Kt=Yt(Be.readFile),Ut=e=>t=>t.startsWith("!")?"!"+G.posix.join(e,t.slice(1)):G.posix.join(e,t),Bt=(e,t)=>{let r=K(G.relative(t.cwd,G.dirname(t.fileName)));return e.split(/\r?\n/).filter(Boolean).filter(n=>!n.startsWith("#")).map(Ut(r))},Ve=e=>{let t=Xt();for(let r of e)t.add(Bt(r.content,{cwd:r.cwd,fileName:r.filePath}));return t},zt=(e,t)=>{if(e=K(e),G.isAbsolute(t)){if(K(t).startsWith(e))return t;throw new Error(`Path ${t} is not in cwd ${e}`)}return G.join(e,t)},Qe=(e,t)=>r=>e.ignores(K(G.relative(t,zt(t,r.path||r)))),Ht=async(e,t)=>{let r=G.join(t,e),n=await Kt(r,"utf8");return{cwd:t,filePath:r,content:n}},Vt=(e,t)=>{let r=G.join(t,e),n=Be.readFileSync(r,"utf8");return{cwd:t,filePath:r,content:n}},Je=({ignore:e=[],cwd:t=K(process.cwd())}={})=>({ignore:e,cwd:t});pe.exports=async e=>{e=Je(e);let t=await ze("**/.gitignore",{ignore:He.concat(e.ignore),cwd:e.cwd}),r=await Promise.all(t.map(o=>Ht(o,e.cwd))),n=Ve(r);return Qe(n,e.cwd)};pe.exports.sync=e=>{e=Je(e);let r=ze.sync("**/.gitignore",{ignore:He.concat(e.ignore),cwd:e.cwd}).map(o=>Vt(o,e.cwd)),n=Ve(r);return Qe(n,e.cwd)}});var tt=N((Lr,et)=>{"use strict";h();var{Transform:Qt}=I("stream"),B=class extends Qt{constructor(){super({objectMode:!0})}},ye=class extends B{constructor(t){super(),this._filter=t}_transform(t,r,n){this._filter(t)&&this.push(t),n()}},he=class extends B{constructor(){super(),this._pushed=new Set}_transform(t,r,n){this._pushed.has(t)||(this.push(t),this._pushed.add(t)),n()}};et.exports={FilterStream:ye,UniqueStream:he}});var or=N((Dr,W)=>{"use strict";h();var nt=I("fs"),z=$e(),Jt=bt(),H=Fe(),V=Ge(),ge=Ze(),{FilterStream:Zt,UniqueStream:er}=tt(),it=()=>!1,rt=e=>e[0]==="!",tr=e=>{if(!e.every(t=>typeof t=="string"))throw new TypeError("Patterns must be a string or an array of strings")},rr=(e={})=>{if(!e.cwd)return;let t;try{t=nt.statSync(e.cwd)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},nr=e=>e.stats instanceof nt.Stats?e.path:e,Q=(e,t)=>{e=z([].concat(e)),tr(e),rr(t);let r=[];t={ignore:[],expandDirectories:!0,...t};for(let[n,o]of e.entries()){if(rt(o))continue;let s=e.slice(n).filter(p=>rt(p)).map(p=>p.slice(1)),d={...t,ignore:t.ignore.concat(s)};r.push({pattern:o,options:d})}return r},ir=(e,t)=>{let r={};return e.options.cwd&&(r.cwd=e.options.cwd),Array.isArray(e.options.expandDirectories)?r={...r,files:e.options.expandDirectories}:typeof e.options.expandDirectories=="object"&&(r={...r,...e.options.expandDirectories}),t(e.pattern,r)},me=(e,t)=>e.options.expandDirectories?ir(e,t):[e.pattern],ot=e=>e&&e.gitignore?ge.sync({cwd:e.cwd,ignore:e.ignore}):it,we=e=>t=>{let{options:r}=e;return r.ignore&&Array.isArray(r.ignore)&&r.expandDirectories&&(r.ignore=V.sync(r.ignore)),{pattern:t,options:r}};W.exports=async(e,t)=>{let r=Q(e,t),n=async()=>t&&t.gitignore?ge({cwd:t.cwd,ignore:t.ignore}):it,o=async()=>{let O=await Promise.all(r.map(async A=>{let i=await me(A,V);return Promise.all(i.map(we(A)))}));return z(...O)},[s,d]=await Promise.all([n(),o()]),p=await Promise.all(d.map(O=>H(O.pattern,O.options)));return z(...p).filter(O=>!s(nr(O)))};W.exports.sync=(e,t)=>{let r=Q(e,t),n=[];for(let d of r){let p=me(d,V.sync).map(we(d));n.push(...p)}let o=ot(t),s=[];for(let d of n)s=z(s,H.sync(d.pattern,d.options));return s.filter(d=>!o(d))};W.exports.stream=(e,t)=>{let r=Q(e,t),n=[];for(let p of r){let O=me(p,V.sync).map(we(p));n.push(...O)}let o=ot(t),s=new Zt(p=>!o(p)),d=new er;return Jt(n.map(p=>H.stream(p.pattern,p.options))).pipe(s).pipe(d)};W.exports.generateGlobTasks=Q;W.exports.hasMagic=(e,t)=>[].concat(e).some(r=>H.isDynamicPattern(r,t));W.exports.gitignore=ge});var st=N((jr,ct)=>{"use strict";h();var C=I("constants"),cr=process.cwd,J=null,sr=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return J||(J=cr.call(process)),J};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Ee=process.chdir,process.chdir=function(e){J=null,Ee.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ee));var Ee;ct.exports=ar;function ar(e){C.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=d(e.chownSync),e.fchownSync=d(e.fchownSync),e.lchownSync=d(e.lchownSync),e.chmodSync=o(e.chmodSync),e.fchmodSync=o(e.fchmodSync),e.lchmodSync=o(e.lchmodSync),e.stat=p(e.stat),e.fstat=p(e.fstat),e.lstat=p(e.lstat),e.statSync=O(e.statSync),e.fstatSync=O(e.fstatSync),e.lstatSync=O(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(i,f,u){u&&process.nextTick(u)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(i,f,u,c){c&&process.nextTick(c)},e.lchownSync=function(){}),sr==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(i){function f(u,c,l){var E=Date.now(),m=0;i(u,c,function _(D){if(D&&(D.code==="EACCES"||D.code==="EPERM")&&Date.now()-E<6e4){setTimeout(function(){e.stat(c,function(L,X){L&&L.code==="ENOENT"?i(u,c,_):l(D)})},m),m<100&&(m+=10);return}l&&l(D)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,i),f}(e.rename)),e.read=typeof e.read!="function"?e.read:function(i){function f(u,c,l,E,m,_){var D;if(_&&typeof _=="function"){var L=0;D=function(X,xe,Oe){if(X&&X.code==="EAGAIN"&&L<10)return L++,i.call(e,u,c,l,E,m,D);_.apply(this,arguments)}}return i.call(e,u,c,l,E,m,D)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,i),f}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(i){return function(f,u,c,l,E){for(var m=0;;)try{return i.call(e,f,u,c,l,E)}catch(_){if(_.code==="EAGAIN"&&m<10){m++;continue}throw _}}}(e.readSync);function t(i){i.lchmod=function(f,u,c){i.open(f,C.O_WRONLY|C.O_SYMLINK,u,function(l,E){if(l){c&&c(l);return}i.fchmod(E,u,function(m){i.close(E,function(_){c&&c(m||_)})})})},i.lchmodSync=function(f,u){var c=i.openSync(f,C.O_WRONLY|C.O_SYMLINK,u),l=!0,E;try{E=i.fchmodSync(c,u),l=!1}finally{if(l)try{i.closeSync(c)}catch{}else i.closeSync(c)}return E}}function r(i){C.hasOwnProperty("O_SYMLINK")&&i.futimes?(i.lutimes=function(f,u,c,l){i.open(f,C.O_SYMLINK,function(E,m){if(E){l&&l(E);return}i.futimes(m,u,c,function(_){i.close(m,function(D){l&&l(_||D)})})})},i.lutimesSync=function(f,u,c){var l=i.openSync(f,C.O_SYMLINK),E,m=!0;try{E=i.futimesSync(l,u,c),m=!1}finally{if(m)try{i.closeSync(l)}catch{}else i.closeSync(l)}return E}):i.futimes&&(i.lutimes=function(f,u,c,l){l&&process.nextTick(l)},i.lutimesSync=function(){})}function n(i){return i&&function(f,u,c){return i.call(e,f,u,function(l){A(l)&&(l=null),c&&c.apply(this,arguments)})}}function o(i){return i&&function(f,u){try{return i.call(e,f,u)}catch(c){if(!A(c))throw c}}}function s(i){return i&&function(f,u,c,l){return i.call(e,f,u,c,function(E){A(E)&&(E=null),l&&l.apply(this,arguments)})}}function d(i){return i&&function(f,u,c){try{return i.call(e,f,u,c)}catch(l){if(!A(l))throw l}}}function p(i){return i&&function(f,u,c){typeof u=="function"&&(c=u,u=null);function l(E,m){m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),c&&c.apply(this,arguments)}return u?i.call(e,f,u,l):i.call(e,f,l)}}function O(i){return i&&function(f,u){var c=u?i.call(e,f,u):i.call(e,f);return c&&(c.uid<0&&(c.uid+=4294967296),c.gid<0&&(c.gid+=4294967296)),c}}function A(i){if(!i||i.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(i.code==="EINVAL"||i.code==="EPERM"))}}});var lt=N((Cr,ut)=>{"use strict";h();var at=I("stream").Stream;ut.exports=ur;function ur(e){return{ReadStream:t,WriteStream:r};function t(n,o){if(!(this instanceof t))return new t(n,o);at.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,o=o||{};for(var d=Object.keys(o),p=0,O=d.length;p<O;p++){var A=d[p];this[A]=o[A]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}e.open(this.path,this.flags,this.mode,function(i,f){if(i){s.emit("error",i),s.readable=!1;return}s.fd=f,s.emit("open",f),s._read()})}function r(n,o){if(!(this instanceof r))return new r(n,o);at.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var s=Object.keys(o),d=0,p=s.length;d<p;d++){var O=s[d];this[O]=o[O]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var dt=N((Mr,ft)=>{"use strict";h();ft.exports=fr;var lr=Object.getPrototypeOf||function(e){return e.__proto__};function fr(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:lr(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var gr=N((kr,ve)=>{"use strict";h();var b=I("fs"),dr=st(),pr=lt(),yr=dt(),Z=I("util"),$,te;typeof Symbol=="function"&&typeof Symbol.for=="function"?($=Symbol.for("graceful-fs.queue"),te=Symbol.for("graceful-fs.previous")):($="___graceful-fs.queue",te="___graceful-fs.previous");function hr(){}function ht(e,t){Object.defineProperty(e,$,{get:function(){return t}})}var k=hr;Z.debuglog?k=Z.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(k=function(){var e=Z.format.apply(Z,arguments);e="GFS4: "+e.split(/\n/).join(`
3
+ GFS4: `),console.error(e)});b[$]||(pt=global[$]||[],ht(b,pt),b.close=function(e){function t(r,n){return e.call(b,r,function(o){o||yt(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(t,te,{value:e}),t}(b.close),b.closeSync=function(e){function t(r){e.apply(b,arguments),yt()}return Object.defineProperty(t,te,{value:e}),t}(b.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){k(b[$]),I("assert").equal(b[$].length,0)}));var pt;global[$]||ht(global,b[$]);ve.exports=Se(yr(b));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!b.__patched&&(ve.exports=Se(b),b.__patched=!0);function Se(e){dr(e),e.gracefulify=Se,e.createReadStream=xe,e.createWriteStream=Oe;var t=e.readFile;e.readFile=r;function r(a,g,y){return typeof g=="function"&&(y=g,g=null),T(a,g,y);function T(P,F,v,x){return t(P,F,function(w){w&&(w.code==="EMFILE"||w.code==="ENFILE")?Y([T,[P,F,v],w,x||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var n=e.writeFile;e.writeFile=o;function o(a,g,y,T){return typeof y=="function"&&(T=y,y=null),P(a,g,y,T);function P(F,v,x,w,R){return n(F,v,x,function(S){S&&(S.code==="EMFILE"||S.code==="ENFILE")?Y([P,[F,v,x,w],S,R||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=d);function d(a,g,y,T){return typeof y=="function"&&(T=y,y=null),P(a,g,y,T);function P(F,v,x,w,R){return s(F,v,x,function(S){S&&(S.code==="EMFILE"||S.code==="ENFILE")?Y([P,[F,v,x,w],S,R||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}var p=e.copyFile;p&&(e.copyFile=O);function O(a,g,y,T){return typeof y=="function"&&(T=y,y=0),P(a,g,y,T);function P(F,v,x,w,R){return p(F,v,x,function(S){S&&(S.code==="EMFILE"||S.code==="ENFILE")?Y([P,[F,v,x,w],S,R||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}var A=e.readdir;e.readdir=f;var i=/^v[0-5]\./;function f(a,g,y){typeof g=="function"&&(y=g,g=null);var T=i.test(process.version)?function(v,x,w,R){return A(v,P(v,x,w,R))}:function(v,x,w,R){return A(v,x,P(v,x,w,R))};return T(a,g,y);function P(F,v,x,w){return function(R,S){R&&(R.code==="EMFILE"||R.code==="ENFILE")?Y([T,[F,v,x],R,w||Date.now(),Date.now()]):(S&&S.sort&&S.sort(),typeof x=="function"&&x.call(this,R,S))}}}if(process.version.substr(0,4)==="v0.8"){var u=pr(e);_=u.ReadStream,L=u.WriteStream}var c=e.ReadStream;c&&(_.prototype=Object.create(c.prototype),_.prototype.open=D);var l=e.WriteStream;l&&(L.prototype=Object.create(l.prototype),L.prototype.open=X),Object.defineProperty(e,"ReadStream",{get:function(){return _},set:function(a){_=a},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return L},set:function(a){L=a},enumerable:!0,configurable:!0});var E=_;Object.defineProperty(e,"FileReadStream",{get:function(){return E},set:function(a){E=a},enumerable:!0,configurable:!0});var m=L;Object.defineProperty(e,"FileWriteStream",{get:function(){return m},set:function(a){m=a},enumerable:!0,configurable:!0});function _(a,g){return this instanceof _?(c.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function D(){var a=this;ne(a.path,a.flags,a.mode,function(g,y){g?(a.autoClose&&a.destroy(),a.emit("error",g)):(a.fd=y,a.emit("open",y),a.read())})}function L(a,g){return this instanceof L?(l.apply(this,arguments),this):L.apply(Object.create(L.prototype),arguments)}function X(){var a=this;ne(a.path,a.flags,a.mode,function(g,y){g?(a.destroy(),a.emit("error",g)):(a.fd=y,a.emit("open",y))})}function xe(a,g){return new e.ReadStream(a,g)}function Oe(a,g){return new e.WriteStream(a,g)}var vt=e.open;e.open=ne;function ne(a,g,y,T){return typeof y=="function"&&(T=y,y=null),P(a,g,y,T);function P(F,v,x,w,R){return vt(F,v,x,function(S,Er){S&&(S.code==="EMFILE"||S.code==="ENFILE")?Y([P,[F,v,x,w],S,R||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}return e}function Y(e){k("ENQUEUE",e[0].name,e[1]),b[$].push(e),_e()}var ee;function yt(){for(var e=Date.now(),t=0;t<b[$].length;++t)b[$][t].length>2&&(b[$][t][3]=e,b[$][t][4]=e);_e()}function _e(){if(clearTimeout(ee),ee=void 0,b[$].length!==0){var e=b[$].shift(),t=e[0],r=e[1],n=e[2],o=e[3],s=e[4];if(o===void 0)k("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-o>=6e4){k("TIMEOUT",t.name,r);var d=r.pop();typeof d=="function"&&d.call(null,n)}else{var p=Date.now()-s,O=Math.max(s-o,1),A=Math.min(O*1.2,100);p>=A?(k("RETRY",t.name,r),t.apply(null,r.concat([o]))):b[$].push(e)}ee===void 0&&(ee=setTimeout(_e,0))}}});var mr=N((Xr,gt)=>{"use strict";h();gt.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var Et=N((Ur,wt)=>{"use strict";h();wt.exports=mt;function mt(e,t){if(e&&t)return mt(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),o=0;o<n.length;o++)n[o]=arguments[o];var s=e.apply(this,n),d=n[n.length-1];return typeof s=="function"&&s!==d&&Object.keys(d).forEach(function(p){s[p]=d[p]}),s}}});var wr=N((zr,be)=>{"use strict";h();var St=Et();be.exports=St(re);be.exports.strict=St(_t);re.proto=re(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return re(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return _t(this)},configurable:!0})});function re(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function _t(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});export{mr as a,Pe as b,or as c,gr as d,Et as e,wr as f};