@shopify/cli-hydrogen 5.2.3 → 5.3.0

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 (37) hide show
  1. package/dist/commands/hydrogen/build.js +42 -20
  2. package/dist/commands/hydrogen/deploy.js +171 -0
  3. package/dist/commands/hydrogen/deploy.test.js +185 -0
  4. package/dist/commands/hydrogen/dev.js +21 -13
  5. package/dist/commands/hydrogen/init.js +10 -6
  6. package/dist/commands/hydrogen/init.test.js +16 -1
  7. package/dist/commands/hydrogen/preview.js +27 -11
  8. package/dist/generator-templates/starter/app/root.tsx +6 -4
  9. package/dist/generator-templates/starter/app/routes/account.tsx +1 -1
  10. package/dist/generator-templates/starter/app/routes/cart.$lines.tsx +70 -0
  11. package/dist/generator-templates/starter/app/routes/cart.tsx +1 -1
  12. package/dist/generator-templates/starter/app/routes/discount.$code.tsx +43 -0
  13. package/dist/generator-templates/starter/app/routes/products.$handle.tsx +3 -1
  14. package/dist/generator-templates/starter/package.json +3 -3
  15. package/dist/generator-templates/starter/remix.env.d.ts +11 -3
  16. package/dist/generator-templates/starter/server.ts +21 -18
  17. package/dist/generator-templates/starter/tsconfig.json +1 -1
  18. package/dist/lib/bundle/analyzer.js +56 -0
  19. package/dist/lib/bundle/bundle-analyzer.html +2045 -0
  20. package/dist/lib/flags.js +4 -0
  21. package/dist/lib/get-oxygen-token.js +47 -0
  22. package/dist/lib/get-oxygen-token.test.js +104 -0
  23. package/dist/lib/graphql/admin/oxygen-token.js +21 -0
  24. package/dist/lib/log.js +56 -13
  25. package/dist/lib/mini-oxygen/common.js +58 -0
  26. package/dist/lib/mini-oxygen/index.js +12 -0
  27. package/dist/lib/{mini-oxygen.js → mini-oxygen/node.js} +27 -52
  28. package/dist/lib/mini-oxygen/types.js +1 -0
  29. package/dist/lib/mini-oxygen/workerd-inspector.js +392 -0
  30. package/dist/lib/mini-oxygen/workerd.js +182 -0
  31. package/dist/lib/onboarding/common.js +4 -4
  32. package/dist/lib/onboarding/local.js +1 -1
  33. package/dist/lib/render-errors.js +1 -1
  34. package/dist/lib/setups/routes/generate.js +1 -1
  35. package/dist/virtual-routes/routes/index.jsx +4 -4
  36. package/oclif.manifest.json +81 -3
  37. package/package.json +12 -4
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.2.3",
2
+ "version": "5.3.0",
3
3
  "commands": {
4
4
  "hydrogen:build": {
5
5
  "id": "hydrogen:build",
@@ -20,7 +20,13 @@
20
20
  "name": "sourcemap",
21
21
  "type": "boolean",
22
22
  "description": "Generate sourcemaps for the build.",
23
- "allowNo": false
23
+ "allowNo": true
24
+ },
25
+ "bundle-stats": {
26
+ "name": "bundle-stats",
27
+ "type": "boolean",
28
+ "description": "Show a bundle size summary after building.",
29
+ "allowNo": true
24
30
  },
25
31
  "disable-route-warning": {
26
32
  "name": "disable-route-warning",
@@ -132,6 +138,59 @@
132
138
  },
133
139
  "args": {}
134
140
  },
141
+ "hydrogen:deploy": {
142
+ "id": "hydrogen:deploy",
143
+ "strict": true,
144
+ "pluginName": "@shopify/cli-hydrogen",
145
+ "pluginAlias": "@shopify/cli-hydrogen",
146
+ "pluginType": "core",
147
+ "hidden": true,
148
+ "aliases": [],
149
+ "flags": {
150
+ "path": {
151
+ "name": "path",
152
+ "type": "option",
153
+ "description": "The path to the directory of the Hydrogen storefront. The default is the current directory.",
154
+ "multiple": false
155
+ },
156
+ "shop": {
157
+ "name": "shop",
158
+ "type": "option",
159
+ "char": "s",
160
+ "description": "Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).",
161
+ "multiple": false
162
+ },
163
+ "publicDeployment": {
164
+ "name": "publicDeployment",
165
+ "type": "boolean",
166
+ "description": "Marks a preview deployment as publicly accessible.",
167
+ "required": false,
168
+ "allowNo": false
169
+ },
170
+ "metadataUrl": {
171
+ "name": "metadataUrl",
172
+ "type": "option",
173
+ "description": "URL that links to the deployment. Will be saved and displayed in the Shopify admin",
174
+ "required": false,
175
+ "multiple": false
176
+ },
177
+ "metadataUser": {
178
+ "name": "metadataUser",
179
+ "type": "option",
180
+ "description": "User that initiated the deployment. Will be saved and displayed in the Shopify admin",
181
+ "required": false,
182
+ "multiple": false
183
+ },
184
+ "metadataVersion": {
185
+ "name": "metadataVersion",
186
+ "type": "option",
187
+ "description": "A version identifier for the deployment. Will be saved and displayed in the Shopify admin",
188
+ "required": false,
189
+ "multiple": false
190
+ }
191
+ },
192
+ "args": {}
193
+ },
135
194
  "hydrogen:dev": {
136
195
  "id": "hydrogen:dev",
137
196
  "description": "Runs Hydrogen storefront in an Oxygen worker for development.",
@@ -154,6 +213,12 @@
154
213
  "multiple": false,
155
214
  "default": 3000
156
215
  },
216
+ "worker-unstable": {
217
+ "name": "worker-unstable",
218
+ "type": "boolean",
219
+ "description": "Run the app in a worker environment closer to Oxygen production instead of a Node.js sandbox. This flag is unstable and may change without notice.",
220
+ "allowNo": false
221
+ },
157
222
  "codegen-unstable": {
158
223
  "name": "codegen-unstable",
159
224
  "type": "boolean",
@@ -286,7 +351,7 @@
286
351
  "type": "boolean",
287
352
  "description": "Generate routes for all pages.",
288
353
  "hidden": true,
289
- "allowNo": false
354
+ "allowNo": true
290
355
  },
291
356
  "git": {
292
357
  "name": "git",
@@ -410,6 +475,19 @@
410
475
  "description": "Port to run the server on.",
411
476
  "multiple": false,
412
477
  "default": 3000
478
+ },
479
+ "worker-unstable": {
480
+ "name": "worker-unstable",
481
+ "type": "boolean",
482
+ "description": "Run the app in a worker environment closer to Oxygen production instead of a Node.js sandbox. This flag is unstable and may change without notice.",
483
+ "allowNo": false
484
+ },
485
+ "env-branch": {
486
+ "name": "env-branch",
487
+ "type": "option",
488
+ "char": "e",
489
+ "description": "Specify an environment's branch name when using remote environment variables.",
490
+ "multiple": false
413
491
  }
414
492
  },
415
493
  "args": {}
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.2.3",
7
+ "version": "5.3.0",
8
8
  "license": "MIT",
9
9
  "type": "module",
10
10
  "scripts": {
@@ -21,7 +21,10 @@
21
21
  "@types/gunzip-maybe": "^1.4.0",
22
22
  "@types/prettier": "^2.7.2",
23
23
  "@types/recursive-readdir": "^2.2.1",
24
+ "@types/stack-trace": "^0.0.30",
24
25
  "@types/tar-fs": "^2.0.1",
26
+ "devtools-protocol": "^0.0.1177611",
27
+ "get-port": "^7.0.0",
25
28
  "@vitest/coverage-v8": "^0.33.0",
26
29
  "fast-glob": "^3.2.12",
27
30
  "flame-chart-js": "2.3.1",
@@ -31,19 +34,24 @@
31
34
  "dependencies": {
32
35
  "@ast-grep/napi": "0.11.0",
33
36
  "@graphql-codegen/cli": "3.3.1",
34
- "@oclif/core": "2.8.11",
35
- "@shopify/cli-kit": "3.48.0",
37
+ "@oclif/core": "2.11.7",
38
+ "@shopify/cli-kit": "3.49.2",
36
39
  "@shopify/hydrogen-codegen": "^0.0.2",
37
40
  "@shopify/mini-oxygen": "^2.2.1",
41
+ "@shopify/oxygen-cli": "^1.12.0",
38
42
  "ansi-escapes": "^6.2.0",
39
43
  "diff": "^5.1.0",
40
44
  "fs-extra": "^11.1.0",
41
45
  "get-port": "^7.0.0",
42
46
  "gunzip-maybe": "^1.4.2",
47
+ "miniflare": "3.20230918.0",
43
48
  "prettier": "^2.8.4",
49
+ "source-map": "^0.7.4",
50
+ "stack-trace": "^1.0.0-pre2",
44
51
  "tar-fs": "^2.1.1",
45
52
  "typescript": "^5.2.2",
46
- "use-resize-observer": "^9.1.0"
53
+ "use-resize-observer": "^9.1.0",
54
+ "ws": "^8.13.0"
47
55
  },
48
56
  "peerDependencies": {
49
57
  "@remix-run/dev": "1.19.1",