@woodsportal/hubspot-kit 5.0.3-beta.1 → 5.0.3-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@woodsportal/hubspot-kit",
3
- "version": "5.0.3-beta.1",
3
+ "version": "5.0.3-beta.2",
4
4
  "packageManager": "pnpm@10.12.1",
5
5
  "description": "WoodsCLI — HubSpot CMS dev kit by WoodsPortal. wp CLI, Vite presets, module-config overlay, and theme/module build pipelines.",
6
6
  "type": "module",
@@ -20,6 +20,16 @@ import {
20
20
  import { wphsPaths } from './wphs-paths.mjs'
21
21
 
22
22
  const roots = []
23
+ /** CI sets GITHUB_REF_NAME; local bump tests must not inherit it (legacy override is tested separately). */
24
+ function localBuildIdEnv(overrides = {}) {
25
+ const env = { ...process.env }
26
+ delete env.GITHUB_REF_NAME
27
+ delete env.GITHUB_REF
28
+ delete env.PORTAL_BUILD_ID
29
+ delete env.MODULE_BUILD_ID
30
+ return { ...env, ...overrides }
31
+ }
32
+
23
33
 
24
34
  function makeProject() {
25
35
  const root = mkdtempSync(join(tmpdir(), 'wp-build-id-'))
@@ -100,11 +110,11 @@ describe('bumpModuleBuildId', () => {
100
110
  const root = makeProject()
101
111
  writeFileSync(join(root, '.wphs', 'config', 'developer.json'), JSON.stringify({ slug: 'manab' }))
102
112
 
103
- const first = bumpModuleBuildId({ projectRoot: root, tier: 'dev' })
113
+ const first = bumpModuleBuildId({ projectRoot: root, tier: 'dev', env: localBuildIdEnv() })
104
114
  assert.equal(first.id, 'v0.0.1-dev.manab.1')
105
115
  assert.equal(first.bumped, true)
106
116
 
107
- const second = bumpModuleBuildId({ projectRoot: root, tier: 'dev' })
117
+ const second = bumpModuleBuildId({ projectRoot: root, tier: 'dev', env: localBuildIdEnv() })
108
118
  assert.equal(second.id, 'v0.0.1-dev.manab.2')
109
119
 
110
120
  const statePath = join(wphsPaths(root).stateDir, 'module-build-id.json')
@@ -112,6 +122,19 @@ describe('bumpModuleBuildId', () => {
112
122
  assert.equal(state.seq, 2)
113
123
  })
114
124
 
125
+ it('uses GITHUB_REF_NAME when set (legacy resolvePortalBuildId CI pin)', () => {
126
+ const root = makeProject()
127
+ writeFileSync(join(root, '.wphs', 'config', 'developer.json'), JSON.stringify({ slug: 'manab' }))
128
+
129
+ const result = bumpModuleBuildId({
130
+ projectRoot: root,
131
+ env: localBuildIdEnv({ GITHUB_REF_NAME: '5.0.2-beta.802' }),
132
+ })
133
+ assert.equal(result.id, '5.0.2-beta.802')
134
+ assert.equal(result.bumped, false)
135
+ assert.equal(result.source, 'github-ref')
136
+ })
137
+
115
138
  it('respects env override without bumping', () => {
116
139
  const root = makeProject()
117
140
  const result = bumpModuleBuildId({