Skip to content

Commit 5b8761b

Browse files
feat(studio): new layout and contextual sidebar (#357)
1 parent 13d3225 commit 5b8761b

File tree

188 files changed

+4986
-9626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+4986
-9626
lines changed

.changeset/new-ads-perform.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@commonalityco/utils-conformance": patch
3+
"@commonalityco/ui-design-system": patch
4+
"@commonalityco/config-tailwind": patch
5+
"@commonalityco/data-packages": patch
6+
"@commonalityco/feature-graph": patch
7+
"@commonalityco/utils-core": patch
8+
"commonality": patch
9+
"workshop": patch
10+
"@commonalityco/studio": patch
11+
---
12+
13+
Update layout of graph and deprecate packages

.commonality/config.json

+13
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,18 @@
3535
"has-client-tsconfig",
3636
"has-npm-ignore"
3737
]
38+
},
39+
"constraints": {
40+
"application": {
41+
"allow": [
42+
"feature",
43+
"ui",
44+
"state",
45+
"data",
46+
"utility",
47+
"config",
48+
"application"
49+
]
50+
}
3851
}
3952
}

.github/workflows/commonality.yml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [main]
88

9+
env:
10+
FORCE_COLOR: 1
11+
912
jobs:
1013
validate:
1114
timeout-minutes: 10

apps/commonality/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"ora": "^7.0.1",
7373
"pathe": "^1.1.2",
7474
"pino": "^8.19.0",
75-
"pino-pretty": "^10.3.1",
7675
"prompts": "^2.4.2",
7776
"std-env": "^3.7.0",
7877
"strip-ansi": "^7.1.0",
@@ -110,4 +109,4 @@
110109
"typescript": "^5.3.3",
111110
"vitest": "^0.34.6"
112111
}
113-
}
112+
}

apps/commonality/src/cli/commands/constrain.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ describe('constrain', () => {
312312
313313
Prevent endless dependency debugging by limiting the which packages can depend on each other.
314314
315-
https://commonality.co/docs/constraints",
315+
https://docs.commonality.co/constraints",
316316
],
317317
]
318318
`);

apps/commonality/src/cli/commands/constrain.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ConstrainLogger extends Logger {
2727
addEmptyMessage() {
2828
const title = c.bold(`You don't have any constraints configured.`);
2929
const body = `Prevent endless dependency debugging by limiting the which packages can depend on each other.`;
30-
const link = 'https://commonality.co/docs/constraints';
30+
const link = 'https://docs.commonality.co/constraints';
3131

3232
this.output += `\n${title}\n\n${body}\n\n${link}`;
3333
}

apps/commonality/src/cli/commands/studio.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ export const studio = command
8080
process.on('SIGINT', handleExit);
8181
process.on('SIGTERM', handleExit);
8282

83-
const localUrl = `http://localhost:${port}/graph`;
84-
const networkUrl = `http://${ip.address()}:${port}/graph`;
83+
const localUrl = `http://localhost:${port}/`;
84+
const networkUrl = `http://${ip.address()}:${port}/`;
8585

8686
await waitOn({ resources: [localUrl], timeout: 10_000 });
8787

apps/studio/e2e/smoke.spec.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
import { test, expect } from '@playwright/test';
22

33
test('smoke - constraints', async ({ page }) => {
4-
await page.goto('/graph');
4+
await page.goto('/');
55

66
await expect(page.getByTestId('dependency-graph')).toBeVisible();
77
});
8-
9-
test('smoke - checks', async ({ page }) => {
10-
await page.goto('/packages');
11-
12-
await expect(page.getByRole('heading', { name: 'Packages' })).toBeVisible();
13-
});

apps/studio/next.config.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ module.exports = {
22
reactStrictMode: true,
33
transpilePackages: [
44
'@commonalityco/ui-design-system',
5-
'@commonalityco/ui-package',
65
'@commonalityco/ui-core',
7-
'@commonalityco/ui-graph',
8-
'@commonalityco/ui-conformance',
9-
'@commonalityco/ui-constraints',
6+
'@commonalityco/feature-graph',
107
],
118
async redirects() {
129
return [
1310
{
14-
source: '/((?!graph|packages).*)',
15-
destination: '/graph',
16-
permanent: true,
11+
source: '/:path+',
12+
destination: '/',
13+
permanent: false, // Set to true if you want the redirect to be permanent
14+
basePath: false,
1715
},
1816
];
1917
},

apps/studio/package.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"dist/"
3131
],
3232
"dependencies": {
33-
"@xyflow/react": "12.0.0-next.9",
33+
"@commonalityco/feature-graph": "workspace:*",
34+
"@xyflow/react": "12.0.0-next.11",
3435
"@xyflow/system": "^0.0.17",
3536
"chokidar": "^3.6.0",
3637
"execa": "^8.0.1",
@@ -52,12 +53,8 @@
5253
"@commonalityco/data-project": "workspace:*",
5354
"@commonalityco/data-tags": "workspace:*",
5455
"@commonalityco/types": "workspace:*",
55-
"@commonalityco/ui-conformance": "workspace:*",
56-
"@commonalityco/ui-constraints": "workspace:*",
5756
"@commonalityco/ui-core": "workspace:*",
5857
"@commonalityco/ui-design-system": "workspace:*",
59-
"@commonalityco/ui-graph": "workspace:*",
60-
"@commonalityco/ui-package": "workspace:*",
6158
"@commonalityco/utils-conformance": "workspace:*",
6259
"@commonalityco/utils-core": "workspace:*",
6360
"@commonalityco/utils-package": "workspace:*",
@@ -84,7 +81,6 @@
8481
"clsx": "^2.1.0",
8582
"cookies-next": "^4.1.1",
8683
"cypress": "^13.6.5",
87-
"cytoscape": "^3.28.1",
8884
"date-fns": "^2.30.0",
8985
"eslint-config-next": "^14.1.0",
9086
"fs-extra": "^11.2.0",
@@ -97,7 +93,6 @@
9793
"open-editor": "^4.1.1",
9894
"path-browserify": "^1.0.1",
9995
"pino": "^8.19.0",
100-
"pino-pretty": "^10.3.1",
10196
"postcss": "^8.4.35",
10297
"prettier": "^3.2.5",
10398
"prettier-plugin-tailwindcss": "^0.5.11",
@@ -121,4 +116,4 @@
121116
"url": "https://github.com/commonalityco/commonality",
122117
"directory": "apps/studio"
123118
}
124-
}
119+
}

apps/studio/src/actions/editor.ts

-44
This file was deleted.

apps/studio/src/actions/graph-actions.ts

-15
This file was deleted.

apps/studio/src/app/[...catchall]/page.ts

-7
This file was deleted.

apps/studio/src/app/globals.css

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@layer base {
99
body {
10-
@apply text-sm bg-background text-foreground;
10+
@apply bg-background text-foreground text-sm;
1111
}
1212

1313
* {
@@ -17,7 +17,7 @@
1717

1818
@layer components {
1919
.react-flow__minimap {
20-
@apply bg-interactive rounded-md border border-muted-foreground/25 overflow-hidden shadow;
20+
@apply bg-interactive border-muted-foreground/25 overflow-hidden rounded-md border shadow;
2121
}
2222

2323
.react-flow__minimap-mask {
@@ -29,6 +29,10 @@
2929
}
3030

3131
.react-flow__nodesselection-rect {
32-
@apply bg-muted-foreground/10 border border-muted-foreground;
32+
@apply bg-muted-foreground/10 border-muted-foreground border;
33+
}
34+
35+
.react-flow__background-pattern.dots {
36+
@apply fill-zinc-500 dark:fill-zinc-500/75;
3337
}
3438
}

apps/studio/src/app/graph/graph-hooks.ts

-69
This file was deleted.

apps/studio/src/app/graph/layout.tsx

-13
This file was deleted.

0 commit comments

Comments
 (0)