@shopify/oxygen-cli 5.0.1-unstable.202507092257.0 → 5.0.1-unstable.202507221549.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.
package/CHANGELOG.md
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
### Patch Changes
|
17
17
|
|
18
|
+
- e4cd96d: returns AbortError instead of Error for build failures
|
18
19
|
- 7977fc5: Update changesets/action from 1.5.0 to 1.5.3
|
19
20
|
- 590b1b3: Update @types/node from 22.15.17 to 22.15.21
|
20
21
|
- 18c232a: Update brace-expansion from 1.1.11 to 1.1.12
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { spawn } from 'child_process';
|
2
2
|
import { PassThrough } from 'stream';
|
3
|
+
import { AbortError } from '@shopify/cli-kit/node/error';
|
3
4
|
import { getBugsnag } from '../utils/bugsnag.js';
|
4
5
|
import { MetricName } from '../utils/metrics-exporter.js';
|
5
6
|
|
@@ -14,7 +15,7 @@ async function buildProject(options) {
|
|
14
15
|
performance.now() - startTime
|
15
16
|
);
|
16
17
|
}).catch((error) => {
|
17
|
-
throw new
|
18
|
+
throw new AbortError(`Build function failed with error: ${error}`);
|
18
19
|
});
|
19
20
|
}
|
20
21
|
const assetPathEnvironment = assetPath ? { HYDROGEN_ASSET_BASE_URL: assetPath } : {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/deploy/build-project.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../src/deploy/build-project.ts"],"names":[],"mappings":";;;;;;AAiBA,eAAsB,aAAa,OAA8B,EAAA;AAC/D,EAAA,MAAM,EAAC,MAAA,EAAQ,SAAW,EAAA,KAAA,EAAS,GAAA,OAAA;AACnC,EAAA,MAAM,UAAU,UAAW,EAAA;AAE3B,EAAA,IAAI,OAAO,aAAe,EAAA;AACxB,IAAM,MAAA,SAAA,GAAY,YAAY,GAAI,EAAA;AAClC,IAAA,OAAO,KACJ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3D,MAAa,YAAA,CAAA,EAAA,CAAG,OAAS,EAAA,CAAC,IAAS,KAAA;AACjC,QAAA,IAAI,SAAS,CAAG,EAAA;AACd,UAAA,OAAA,CAAQ,eAAiB,EAAA,GAAA;AAAA,YACvB,UAAW,CAAA,SAAA;AAAA,YACX,WAAA,CAAY,KAAQ,GAAA;AAAA,WACtB;AAAA;AAEF,QAAA,OAAA,EAAS,YAAY,cAAgB,EAAA;AAAA,UACnC,SAAS,MAAO,CAAA,YAAA;AAAA,UAChB,MAAA;AAAA,UACA;AAAA,SACD,CAAA;AACD,QAAA,IAAI,SAAS,CAAG,EAAA;AACd,UAAA,MAAA,CAAO,IAAI,CAAA;AACX,UAAA;AAAA;AAEF,QAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,OACb,CAAA;AAAA,KACF,CAAA;AAAA,WACM,KAAO,EAAA;AACd,IAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,KAAK,CAAE,CAAA,CAAA;AAAA;AAE5D","file":"build-project.js","sourcesContent":["import {spawn} from 'child_process';\nimport {PassThrough, Readable} from 'stream';\n\nimport {AbortError} from '@shopify/cli-kit/node/error';\n\nimport {getBugsnag} from '../utils/bugsnag.js';\nimport {MetricsExporter, MetricName} from '../utils/metrics-exporter.js';\n\nimport {DeploymentConfig, DeploymentHooks} from './types.js';\n\ninterface BuildProjectOptions {\n config: DeploymentConfig;\n assetPath?: string;\n hooks?: DeploymentHooks;\n metricsExporter?: MetricsExporter;\n}\n\nexport async function buildProject(options: BuildProjectOptions) {\n const {config, assetPath, hooks} = options;\n const Bugsnag = getBugsnag();\n\n if (hooks?.buildFunction) {\n const startTime = performance.now();\n return hooks\n .buildFunction(assetPath)\n .then(() => {\n options.metricsExporter?.add(\n MetricName.BuildTime,\n performance.now() - startTime,\n );\n })\n .catch((error) => {\n throw new AbortError(`Build function failed with error: ${error}`);\n });\n }\n\n const assetPathEnvironment = assetPath\n ? {HYDROGEN_ASSET_BASE_URL: assetPath}\n : {};\n try {\n await new Promise((resolve, reject) => {\n let stderr = '';\n const stderrStream = new PassThrough();\n\n stderrStream.on('data', (chunk) => {\n stderr += chunk;\n process.stderr.write(chunk);\n });\n\n const startTime = performance.now();\n const buildCommand = spawn(config.buildCommand!, [], {\n stdio: ['inherit', 'pipe', 'pipe'],\n env: {\n // eslint-disable-next-line no-process-env\n ...process.env,\n ...assetPathEnvironment,\n },\n cwd: config.rootPath,\n shell: true,\n });\n\n (buildCommand.stderr as Readable | null)?.pipe(stderrStream);\n (buildCommand.stdout as Readable | null)?.pipe(stderrStream);\n\n buildCommand.on('close', (code) => {\n if (code === 0) {\n options.metricsExporter?.add(\n MetricName.BuildTime,\n performance.now() - startTime,\n );\n }\n Bugsnag?.addMetadata('buildCommand', {\n command: config.buildCommand,\n stderr,\n code,\n });\n if (code !== 0) {\n reject(code);\n return;\n }\n resolve(code);\n });\n });\n } catch (error) {\n throw new Error(`Build failed with error code: ${error}`);\n }\n}\n"]}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
"@shopify:registry": "https://registry.npmjs.org"
|
6
6
|
},
|
7
7
|
"license": "MIT",
|
8
|
-
"version": "5.0.1-unstable.
|
8
|
+
"version": "5.0.1-unstable.202507221549.0",
|
9
9
|
"type": "module",
|
10
10
|
"scripts": {
|
11
11
|
"build": "tsup --sourcemap --clean --config ./tsup.config.ts && oclif manifest",
|