Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ jobs:
comment_suffix: "
> [!CAUTION]

> After installing, validate the version by running just `shopify` in your terminal.
> After installing, validate the version by running `shopify version` in your terminal.

> If the versions don't match, you might have multiple global instances installed.

> Use `which shopify` to find out which one you are running and uninstall it."
comment_package_manager: 'npm'
comment_command_flags: '--@shopify:registry=https://registry.npmjs.org'
build_script: "pnpm nx run-many --target=bundle --all --skip-nx-cache --output-style=stream && pnpm refresh-manifests"
build_script: "node bin/update-cli-kit-version.js && pnpm nx run-many --target=bundle --all --skip-nx-cache --output-style=stream && pnpm refresh-manifests"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ''
Expand Down
14 changes: 11 additions & 3 deletions bin/update-cli-kit-version.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/usr/bin/env node
import {readFileSync, writeFile, writeFileSync} from 'fs';
import {readFileSync, writeFileSync} from 'fs'
import {dirname, join} from 'path'
import {fileURLToPath} from 'url'

// Always work from the repo root (where this script is located in bin/)
const __dirname = dirname(fileURLToPath(import.meta.url))
const repoRoot = join(__dirname, '..')

// Update the cli-kit version in version.ts
const cliKitVersion = JSON.parse(readFileSync('packages/cli-kit/package.json')).version
const packageJsonPath = join(repoRoot, 'packages/cli-kit/package.json')
const cliKitVersion = JSON.parse(readFileSync(packageJsonPath, 'utf-8')).version
const versionFilePath = join(repoRoot, 'packages/cli-kit/src/public/common/version.ts')
const content = `export const CLI_KIT_VERSION = '${cliKitVersion}'\n`
writeFileSync('packages/cli-kit/src/public/common/version.ts', content)
writeFileSync(versionFilePath, content)
15 changes: 15 additions & 0 deletions packages/cli-kit/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,26 @@
"inputs": [
"{projectRoot}/src/**/*"
],
"dependsOn": [
"generate-version"
],
"options": {
"command": "pnpm tsc -b ./tsconfig.build.json",
"cwd": "packages/cli-kit"
}
},
"generate-version": {
"executor": "nx:run-commands",
"outputs": [
"{projectRoot}/src/public/common/version.ts"
],
"inputs": [
"{projectRoot}/package.json"
],
"options": {
"command": "node bin/update-cli-kit-version.js"
}
},
"build-api-docs": {
"executor": "nx:run-commands",
"outputs": [
Expand Down
5 changes: 5 additions & 0 deletions packages/cli/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"bundle": {
"executor": "nx:run-commands",
"dependsOn": [
"cli-kit:generate-version",
"app:build",
"theme:build"
],
"options": {
"command": "node bin/bundle",
"cwd": "packages/cli"
Expand Down
Loading