Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .github/actions/cli-rewrite-sdk-scope-for-gpr/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CLI - Rewrite SDK Scope for GPR
description: Rewrites @qvac/sdk references to @tetherto/sdk-mono in qvac-cli source for GPR publishing

runs:
using: composite
steps:
- name: Rewrite @qvac/sdk references for GPR
shell: bash
working-directory: packages/qvac-cli
run: |
# GPR SDK package name
NEW_SDK_NAME="@tetherto/sdk-mono"

echo "Rewriting @qvac/sdk → $NEW_SDK_NAME in source files..."

# Update constants.js
CONSTANTS_FILE="src/bundle-sdk/constants.js"
if [ -f "$CONSTANTS_FILE" ]; then
sed -i.bak "s|@qvac/sdk|${NEW_SDK_NAME}|g" "$CONSTANTS_FILE"
rm "${CONSTANTS_FILE}.bak"
echo "✓ Updated $CONSTANTS_FILE"
fi

# Update index.js (path resolution uses '@qvac' and 'sdk' as separate segments)
INDEX_FILE="src/bundle-sdk/index.js"
if [ -f "$INDEX_FILE" ]; then
sed -i.bak "s|'@qvac'|'@tetherto'|g" "$INDEX_FILE"
sed -i.bak "s|'sdk'|'sdk-mono'|g" "$INDEX_FILE"
sed -i.bak "s|@qvac/sdk|${NEW_SDK_NAME}|g" "$INDEX_FILE"
rm "${INDEX_FILE}.bak"
echo "✓ Updated $INDEX_FILE"
fi
12 changes: 12 additions & 0 deletions .github/workflows/trigger-reusable-lib-qvac-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Rewrite SDK scope for GPR
uses: ./.github/actions/cli-rewrite-sdk-scope-for-gpr

- name: Publish to GitHub Packages (dev)
uses: tetherto/qvac-devops/.github/actions/publish-library-to-gpr@monorepo_update
with:
Expand Down Expand Up @@ -132,6 +136,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Rewrite SDK scope for GPR
uses: ./.github/actions/cli-rewrite-sdk-scope-for-gpr

- name: Publish to GitHub Packages (feature)
uses: tetherto/qvac-devops/.github/actions/publish-library-to-gpr@monorepo_update
with:
Expand All @@ -153,6 +161,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Rewrite SDK scope for GPR
uses: ./.github/actions/cli-rewrite-sdk-scope-for-gpr

- name: Publish to GitHub Packages (tmp)
uses: tetherto/qvac-devops/.github/actions/publish-library-to-gpr@monorepo_update
with:
Expand Down
4 changes: 2 additions & 2 deletions packages/qvac-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qvac/qvac-cli",
"version": "0.1.1",
"name": "@qvac/cli",
"version": "0.1.0",
"description": "Command-line interface for the QVAC ecosystem",
Comment thread
lauripiisang marked this conversation as resolved.
"author": "Tether",
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/qvac-cli/src/bundle-sdk/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export async function bundleSdk (options = {}) {
const sdkName = await resolveSdkName(projectRoot)
logger.log(`📦 SDK: ${sdkName}`)

const importsMapPath = resolveImportsMapPath(projectRoot, sdkName)

const pluginSpecifiers = resolvePluginSpecifiers(config, sdkName, logger)
logger.log(`\n📦 Plugins to include (${pluginSpecifiers.length}):`)
for (const spec of pluginSpecifiers) {
Expand Down Expand Up @@ -124,8 +126,6 @@ export async function bundleSdk (options = {}) {
)
await fsp.writeFile(pearWorkerEntryPath, pearWorkerEntry, 'utf8')
logger.log(` Created: ${path.relative(projectRoot, pearWorkerEntryPath)}`)

const importsMapPath = resolveImportsMapPath(projectRoot, sdkName)
logger.log(` Using: ${path.relative(projectRoot, importsMapPath)}`)

logger.log('\n🔨 Bundling with bare-pack...')
Expand Down
Loading