File tree Expand file tree Collapse file tree 30 files changed +104
-54
lines changed Expand file tree Collapse file tree 30 files changed +104
-54
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @postgres.ai/ce" ,
3
- "version" : " 3.5 .0" ,
3
+ "version" : " 4.0 .0" ,
4
4
"private" : true ,
5
5
"dependencies" : {
6
6
"@craco/craco" : " ^6.4.3" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { useParams } from 'react-router-dom'
3
3
import { getBranches } from 'api/branches/getBranches'
4
4
import { deleteBranch } from 'api/branches/deleteBranch'
5
5
import { getSnapshotList } from 'api/branches/getSnapshotList'
6
+ import { initWS } from 'api/engine/initWS'
6
7
7
8
import { PageContainer } from 'components/PageContainer'
8
9
import { NavPath } from 'components/NavPath'
@@ -20,6 +21,7 @@ export const Branch = () => {
20
21
getBranches,
21
22
deleteBranch,
22
23
getSnapshotList,
24
+ initWS
23
25
}
24
26
25
27
const elements = {
Original file line number Diff line number Diff line change 1
1
import { getBranches } from 'api/branches/getBranches'
2
2
import { createBranch } from 'api/branches/createBranch'
3
3
import { getSnapshots } from 'api/snapshots/getSnapshots'
4
+ import { initWS } from 'api/engine/initWS'
4
5
5
6
import { CreateBranchPage } from '@postgres.ai/shared/pages/CreateBranch'
6
7
@@ -18,6 +19,7 @@ export const CreateBranch = () => {
18
19
getBranches,
19
20
createBranch,
20
21
getSnapshots,
22
+ initWS
21
23
}
22
24
23
25
const elements = {
Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ import { resetClone } from 'api/clones/resetClone'
10
10
import { destroyClone } from 'api/clones/destroyClone'
11
11
import { updateClone } from 'api/clones/updateClone'
12
12
import { createSnapshot } from 'api/snapshots/createSnapshot'
13
+ import { initWS } from 'api/engine/initWS'
14
+ import { destroySnapshot } from 'api/snapshots/destroySnapshot'
13
15
14
16
import { PageContainer } from 'components/PageContainer'
15
17
import { NavPath } from 'components/NavPath'
16
18
import { ROUTES } from 'config/routes'
17
- import { destroySnapshot } from 'api/snapshots/destroySnapshot'
18
19
19
20
type Params = {
20
21
cloneId : string
@@ -33,6 +34,7 @@ export const Clone = () => {
33
34
destroySnapshot,
34
35
updateClone,
35
36
createSnapshot,
37
+ initWS,
36
38
}
37
39
38
40
const elements = {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { createClone } from 'api/clones/createClone'
9
9
import { getClone } from 'api/clones/getClone'
10
10
import { getBranches } from 'api/branches/getBranches'
11
11
import { getSnapshots } from 'api/snapshots/getSnapshots'
12
+ import { initWS } from 'api/engine/initWS'
12
13
13
14
export const CreateClone = ( ) => {
14
15
const routes = {
@@ -23,6 +24,7 @@ export const CreateClone = () => {
23
24
getClone,
24
25
getBranches,
25
26
getSnapshots,
27
+ initWS
26
28
}
27
29
28
30
const elements = {
Original file line number Diff line number Diff line change 1
1
import { createSnapshot } from 'api/snapshots/createSnapshot'
2
2
import { getInstance } from 'api/instances/getInstance'
3
+ import { initWS } from 'api/engine/initWS'
3
4
4
5
import { CreateSnapshotPage } from '@postgres.ai/shared/pages/CreateSnapshot'
5
6
@@ -11,6 +12,7 @@ export const CreateSnapshot = () => {
11
12
const api = {
12
13
createSnapshot,
13
14
getInstance,
15
+ initWS
14
16
}
15
17
16
18
const elements = {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { PageContainer } from 'components/PageContainer'
9
9
import { destroySnapshot } from 'api/snapshots/destroySnapshot'
10
10
import { getSnapshots } from 'api/snapshots/getSnapshots'
11
11
import { getBranchSnapshot } from 'api/snapshots/getBranchSnapshot'
12
+ import { initWS } from 'api/engine/initWS'
12
13
13
14
type Params = {
14
15
snapshotId : string
@@ -21,6 +22,7 @@ export const Snapshot = () => {
21
22
destroySnapshot,
22
23
getSnapshots,
23
24
getBranchSnapshot,
25
+ initWS,
24
26
}
25
27
26
28
const elements = {
Original file line number Diff line number Diff line change @@ -27,15 +27,25 @@ publish-shared-preview:
27
27
- cd ui/packages/shared
28
28
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
29
29
30
- # Get base version from package.json (strip any -pr or other suffix)
30
+ # Get base version from package.json (strip any suffix)
31
31
- BASE_VERSION=$(jq -r .version package.json)
32
32
- BASE_VERSION=${BASE_VERSION%%-*}
33
33
- export PREID="pr-${CI_MERGE_REQUEST_IID:-preview}"
34
34
35
- # Detect next available patch for same PR
36
- - EXISTING_TAGS=$(npm view @postgres.ai/shared versions --json | jq -r '.[]' | grep "^${BASE_VERSION}-${PREID}" || true)
37
- - COUNT=$(echo "$EXISTING_TAGS" | wc -l | xargs)
38
- - if [ "$COUNT" -eq 0 ]; then VERSION="${BASE_VERSION}-${PREID}"; else VERSION="${BASE_VERSION}-${PREID}.${COUNT}"; fi
35
+ # Get all existing versions
36
+ - EXISTING_TAGS=$(npm view @postgres.ai/shared versions --json | jq -r '.[]' || echo "")
37
+
38
+ # Find next available version suffix
39
+ - VERSION=""
40
+ - for i in $(seq 0 20); do
41
+ CANDIDATE="${BASE_VERSION}-${PREID}";
42
+ [ "$i" -gt 0 ] && CANDIDATE="${CANDIDATE}.${i}";
43
+ if ! echo "$EXISTING_TAGS" | grep -qx "$CANDIDATE"; then
44
+ VERSION="$CANDIDATE";
45
+ break;
46
+ fi;
47
+ done
48
+ - if [ -z "$VERSION" ]; then echo "❌ Failed to determine unique preview version"; exit 1; fi
39
49
- echo "Publishing version $VERSION"
40
50
- npm version "$VERSION" --no-git-tag-version
41
51
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @postgres.ai/shared" ,
3
- "version" : " 3.5 .0" ,
3
+ "version" : " 4.0 .0" ,
4
4
"scripts" : {
5
5
"build" : " tsc -p tsconfig.build.json && node scripts/copy-assets.js" ,
6
6
"pack" : " node scripts/pack.js"
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ import { Host } from './context'
43
43
import { DeleteBranch } from '@postgres.ai/shared/types/api/endpoints/deleteBranch'
44
44
import { InstanceTabs , TABS_INDEX } from "../../Instance/Tabs" ;
45
45
46
- type Props = Host & { isPlatform ?: boolean }
46
+ type Props = Host & { isPlatform ?: boolean , hideBranchingFeatures ?: boolean }
47
47
48
48
const useStyles = makeStyles (
49
49
( ) => ( {
@@ -187,6 +187,8 @@ export const BranchesPage = observer((props: Props) => {
187
187
tab = { TABS_INDEX . BRANCHES }
188
188
isPlatform = { props . isPlatform }
189
189
instanceId = { props . instanceId }
190
+ hasLogs = { props . api . initWS !== undefined }
191
+ hideInstanceTabs = { props . hideBranchingFeatures }
190
192
/>
191
193
</ SectionTitle >
192
194
</ >
You can’t perform that action at this time.
0 commit comments