@shopify/cli-hydrogen 3.0.6 → 3.0.9
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @shopify/cli-hydrogen
|
|
2
2
|
|
|
3
|
+
## 3.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @shopify/cli-kit@3.0.9
|
|
8
|
+
|
|
9
|
+
## 3.0.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- @shopify/cli-kit@3.0.8
|
|
14
|
+
|
|
15
|
+
## 3.0.7
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [8de7f95d]
|
|
20
|
+
- @shopify/cli-kit@3.0.7
|
|
21
|
+
|
|
3
22
|
## 3.0.6
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -42,7 +42,7 @@ async function previewInWorker({ directory, port }) {
|
|
|
42
42
|
stdout: process.stdout
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
const OxygenPreviewExecutableNotFound = new error.
|
|
45
|
+
const OxygenPreviewExecutableNotFound = new error.Bug("Could not locate the executable file to run Oxygen locally.");
|
|
46
46
|
async function oxygenPreviewExecutable() {
|
|
47
47
|
const cwd = path.dirname(fileURLToPath(import.meta.url));
|
|
48
48
|
const executablePath = await path.findUp("node_modules/.bin/oxygen-preview", { type: "file", cwd });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.js","sources":["../../../src/cli/services/preview.ts","../../../src/cli/commands/hydrogen/preview.ts"],"sourcesContent":["import {path, error, system, file, output} from '@shopify/cli-kit'\nimport {fileURLToPath} from 'url'\n\ninterface PreviewOptions {\n directory: string\n port: number\n}\n\nexport async function previewInNode({directory, port}: PreviewOptions) {\n const buildOutputPath = await path.resolve(directory, 'dist/node')\n\n if (!(await file.exists(buildOutputPath))) {\n output.info(\n output.content`Couldn’t find a Node.js server build for this project. Running ${output.token.command(\n 'yarn',\n 'shopify hydrogen build',\n '--target=node',\n )} to create one.`,\n )\n\n await system.exec('yarn', ['shopify', 'hydrogen', 'build', '--target=node'], {\n cwd: directory,\n stdout: process.stdout,\n })\n }\n\n await system.exec('node', ['--enable-source-maps', buildOutputPath], {\n env: {PORT: `${port}`},\n cwd: directory,\n stdout: process.stdout,\n })\n}\n\nexport async function previewInWorker({directory, port}: PreviewOptions) {\n const config = {\n port,\n workerFile: 'dist/worker/index.js',\n assetsDir: 'dist/client',\n buildCommand: 'yarn build',\n modules: true,\n watch: true,\n buildWatchPaths: ['./src'],\n autoReload: true,\n }\n\n await file.write(path.resolve(directory, 'mini-oxygen.config.json'), JSON.stringify(config, null, 2))\n\n function cleanUp(options: {exit: boolean}) {\n if (options.exit) {\n file.remove(path.resolve(directory, 'mini-oxygen.config.json'))\n }\n }\n\n process.on('SIGINT', cleanUp.bind(null, {exit: true}))\n\n const executable = await oxygenPreviewExecutable()\n\n await system.exec(executable, [], {\n env: {NODE_OPTIONS: '--experimental-vm-modules'},\n cwd: directory,\n stdout: process.stdout,\n })\n}\n\nexport const OxygenPreviewExecutableNotFound = new error.
|
|
1
|
+
{"version":3,"file":"preview.js","sources":["../../../src/cli/services/preview.ts","../../../src/cli/commands/hydrogen/preview.ts"],"sourcesContent":["import {path, error, system, file, output} from '@shopify/cli-kit'\nimport {fileURLToPath} from 'url'\n\ninterface PreviewOptions {\n directory: string\n port: number\n}\n\nexport async function previewInNode({directory, port}: PreviewOptions) {\n const buildOutputPath = await path.resolve(directory, 'dist/node')\n\n if (!(await file.exists(buildOutputPath))) {\n output.info(\n output.content`Couldn’t find a Node.js server build for this project. Running ${output.token.command(\n 'yarn',\n 'shopify hydrogen build',\n '--target=node',\n )} to create one.`,\n )\n\n await system.exec('yarn', ['shopify', 'hydrogen', 'build', '--target=node'], {\n cwd: directory,\n stdout: process.stdout,\n })\n }\n\n await system.exec('node', ['--enable-source-maps', buildOutputPath], {\n env: {PORT: `${port}`},\n cwd: directory,\n stdout: process.stdout,\n })\n}\n\nexport async function previewInWorker({directory, port}: PreviewOptions) {\n const config = {\n port,\n workerFile: 'dist/worker/index.js',\n assetsDir: 'dist/client',\n buildCommand: 'yarn build',\n modules: true,\n watch: true,\n buildWatchPaths: ['./src'],\n autoReload: true,\n }\n\n await file.write(path.resolve(directory, 'mini-oxygen.config.json'), JSON.stringify(config, null, 2))\n\n function cleanUp(options: {exit: boolean}) {\n if (options.exit) {\n file.remove(path.resolve(directory, 'mini-oxygen.config.json'))\n }\n }\n\n process.on('SIGINT', cleanUp.bind(null, {exit: true}))\n\n const executable = await oxygenPreviewExecutable()\n\n await system.exec(executable, [], {\n env: {NODE_OPTIONS: '--experimental-vm-modules'},\n cwd: directory,\n stdout: process.stdout,\n })\n}\n\nexport const OxygenPreviewExecutableNotFound = new error.Bug(\n 'Could not locate the executable file to run Oxygen locally.',\n)\n\nasync function oxygenPreviewExecutable(): Promise<string> {\n const cwd = path.dirname(fileURLToPath(import.meta.url))\n const executablePath = await path.findUp('node_modules/.bin/oxygen-preview', {type: 'file', cwd})\n if (!executablePath) {\n throw OxygenPreviewExecutableNotFound\n }\n return executablePath\n}\n","import {previewInWorker, previewInNode} from '../../services/preview'\nimport {path, cli} from '@shopify/cli-kit'\nimport {Command, Flags} from '@oclif/core'\n\nexport default class Preview extends Command {\n static description = 'Run a Hydrogen storefront locally in a worker environment'\n static flags = {\n ...cli.globalFlags,\n path: Flags.string({\n hidden: true,\n description: 'the path to your hydrogen storefront',\n env: 'SHOPIFY_FLAG_PATH',\n }),\n port: Flags.string({\n char: 'p',\n hidden: true,\n description: 'the port to run the preview server on',\n default: '3000',\n env: 'SHOPIFY_FLAG_PORT',\n }),\n target: Flags.string({\n char: 't',\n description: 'the target environment (worker or node)',\n options: ['node', 'worker'],\n default: 'worker',\n env: 'SHOPIFY_FLAG_PREVIEW_TARGET',\n }),\n }\n\n async run(): Promise<void> {\n const {flags} = await this.parse(Preview)\n const directory = flags.path ? path.resolve(flags.path) : process.cwd()\n const port = parseInt(flags.port, 10)\n\n if (flags.target === 'worker') {\n await previewInWorker({directory, port})\n } else if (flags.target === 'node') {\n await previewInNode({directory, port})\n }\n }\n}\n"],"names":[],"mappings":";;;;AAQoC,eAAA,aAAA,CAAA,EAAC,WAAW,IAAuB,EAAA,EAAA;AACrE,EAAA,MAAM,eAAkB,GAAA,MAAM,IAAK,CAAA,OAAA,CAAQ,WAAW,WAAW,CAAA,CAAA;AAEjE,EAAA,IAAI,CAAE,MAAM,IAAK,CAAA,MAAA,CAAO,eAAe,CAAI,EAAA;AACzC,IAAO,MAAA,CAAA,IAAA,CACL,OAAO,OAAyE,CAAA,+DAAA,EAAA,MAAA,CAAO,MAAM,OAC3F,CAAA,MAAA,EACA,wBACA,EAAA,eACF,CACF,CAAA,eAAA,CAAA,CAAA,CAAA;AAEA,IAAM,MAAA,MAAA,CAAO,KAAK,MAAQ,EAAA,CAAC,WAAW,UAAY,EAAA,OAAA,EAAS,eAAe,CAAG,EAAA;AAAA,MAC3E,GAAK,EAAA,SAAA;AAAA,MACL,QAAQ,OAAQ,CAAA,MAAA;AAAA,KACjB,CAAA,CAAA;AAAA,GACH;AAEA,EAAA,MAAM,OAAO,IAAK,CAAA,MAAA,EAAQ,CAAC,sBAAA,EAAwB,eAAe,CAAG,EAAA;AAAA,IACnE,GAAK,EAAA,EAAC,IAAM,EAAA,CAAA,EAAG,IAAM,CAAA,CAAA,EAAA;AAAA,IACrB,GAAK,EAAA,SAAA;AAAA,IACL,QAAQ,OAAQ,CAAA,MAAA;AAAA,GACjB,CAAA,CAAA;AACH,CAAA;AAEsC,eAAA,eAAA,CAAA,EAAC,WAAW,IAAuB,EAAA,EAAA;AACvE,EAAA,MAAM,MAAS,GAAA;AAAA,IACb,IAAA;AAAA,IACA,UAAY,EAAA,sBAAA;AAAA,IACZ,SAAW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Q,EAAA,IAAA;AAAA,IACR,WAAa,EAAA,uCAAA;AAAA,IACb,OAAS,EAAA,MAAA;AAAA,IACT,GAAK,EAAA,mBAAA;AAAA,GACN,CAAA;AAAA,EACD,MAAA,EAAQ,MAAM,MAAO,CAAA;AAAA,IACnB,IAAM,EAAA,GAAA;AAAA,IACN,WAAa,EAAA,yCAAA;AAAA,IACb,OAAA,EAAS,CAAC,MAAA,EAAQ,QAAQ,CAAA;AAAA,IAC1B,OAAS,EAAA,QAAA;AAAA,IACT,GAAK,EAAA,6BAAA;AAAA,GACN,CAAA;AACH,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/cli-hydrogen",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Commands for building Hydrogen storefronts",
|
|
6
6
|
"type": "module",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"vite": "^2.9.9"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@shopify/cli-kit": "3.0.
|
|
43
|
+
"@shopify/cli-kit": "3.0.9"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@babel/core": "^7.17.10",
|
|
47
47
|
"@shopify/ast-utilities": "^1.3.4",
|
|
48
|
-
"@shopify/cli-testing": "3.0.
|
|
48
|
+
"@shopify/cli-testing": "3.0.9",
|
|
49
49
|
"@shopify/prettier-config": "^1.1.2",
|
|
50
50
|
"@types/change-case": "^2.3.1",
|
|
51
51
|
"@types/connect": "^3.4.35",
|