Skip to content

Commit 85d2fb9

Browse files
authored
feat(csk-recipes): use package version for external branch suffix (#165)
1 parent 6ee96ce commit 85d2fb9

13 files changed

Lines changed: 32 additions & 26 deletions

File tree

apps/csk-marketing-site/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uniformdev/csk-marketing-site",
3-
"version": "6.0.103",
3+
"version": "6.0.104",
44
"private": true,
55
"engines": {
66
"yarn": "please-use-npm",

apps/csk-storybook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uniformdev/csk-storybook",
3-
"version": "6.0.103",
3+
"version": "6.0.104",
44
"description": "CSK vNext Storybook is an interactive Storybook build showcasing components from the CSK vNext component starter kit. It provides detailed documentation, live previews, and testing capabilities for easy integration into your projects.",
55
"main": "index.js",
66
"scripts": {

apps/csk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uniformdev/component-starter-kit",
3-
"version": "6.0.103",
3+
"version": "6.0.104",
44
"private": true,
55
"engines": {
66
"yarn": "please-use-npm",

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "csk-packages",
3-
"version": "6.0.103",
3+
"version": "6.0.104",
44
"private": true,
55
"scripts": {
66
"build": "turbo build",

packages/csk-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uniformdev/csk-cli",
3-
"version": "6.0.103",
3+
"version": "6.0.104",
44
"description": "Command-line interface (CLI) tool designed to streamline the development workflow within Uniform projects. It provides commands for pulling additional data and generating components based on Canvas data",
55
"license": "SEE LICENSE IN LICENSE.txt",
66
"engines": {

packages/csk-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uniformdev/csk-components",
3-
"version": "6.0.103",
3+
"version": "6.0.104",
44
"description": "Components Starter Kit that provides a set of basic components for building websites within a Uniform project",
55
"license": "SEE LICENSE IN LICENSE.txt",
66
"engines": {

packages/csk-recipes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uniformdev/csk-recipes",
3-
"version": "6.0.103",
3+
"version": "6.0.104",
44
"description": "command-line interface (CLI) and utility functions to help you work with recipes in a CSK project. It simplifies project initialization by allowing you to choose templates and include specific recipes",
55
"license": "SEE LICENSE IN LICENSE.txt",
66
"engines": {

packages/csk-recipes/src/commands/init/utils.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
RECIPE_SPECIFIC_BRANCHES,
2323
TEMPLATES,
2424
REQUIRED_UNIFORM_ENV_VARIABLES,
25+
PACKAGE_VERSION,
2526
} from '../../constants';
2627
import { runCmdCommand, spawnCmdCommand } from '../../utils';
2728

@@ -322,11 +323,12 @@ export const copyDirectory = (sourceDir: string, targetDir: string): void => {
322323
};
323324

324325
/**
325-
* Gets the external branch name based on the template.
326+
* Returns the formatted external branch name based on template, recipes, and environment.
326327
*
327-
* @param {string} template - The template name
328-
* @param {Recipe[]} recipes - The recipes to check
329-
* @returns {string} The formatted branch name
328+
* @param template - Template name (e.g., 'baseline' or other)
329+
* @param recipes - Array of Recipe identifiers
330+
* @param dev - Whether to use the dev suffix or package version
331+
* @returns Formatted branch name string
330332
*/
331333
export const getExternalBranchName = (template: string, recipes: Recipe[], dev: boolean): string => {
332334
const getBranchName = () => {
@@ -345,7 +347,8 @@ export const getExternalBranchName = (template: string, recipes: Recipe[], dev:
345347
return `${TEMPLATE_BRANCH_PREFIX_LOCAL}${template}`;
346348
};
347349

348-
return dev ? `${getBranchName()}-dev` : getBranchName();
350+
const suffix = dev ? '-dev' : `-${PACKAGE_VERSION}`;
351+
return `${getBranchName()}${suffix}`;
349352
};
350353

351354
/**

packages/csk-recipes/src/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import packageJson from '../package.json';
12
import { EnvVariable, Recipe, Template } from './commands/init/types';
23

4+
export const PACKAGE_VERSION = packageJson.version;
5+
36
export const TEMPLATE_BRANCH_PREFIX = 'refs/heads/templates/';
47
export const TEMPLATE_BRANCH_PREFIX_LOCAL = 'templates/';
58

0 commit comments

Comments
 (0)