@taruvi/navkit 0.0.29 → 0.0.31
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/.github/workflows/publish.yml +65 -0
- package/package.json +4 -2
- package/src/App.styles.ts +10 -3
- package/src/App.tsx +23 -21
- package/src/components/Shortucts/Shortcuts.tsx +11 -10
- package/src/dummy.test.ts +5 -0
- package/.claude/settings.local.json +0 -12
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- beta
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
18
|
+
|
|
19
|
+
- uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: '20'
|
|
22
|
+
registry-url: 'https://registry.npmjs.org'
|
|
23
|
+
|
|
24
|
+
- run: npm ci
|
|
25
|
+
|
|
26
|
+
- run: npm test
|
|
27
|
+
|
|
28
|
+
- run: npm run build
|
|
29
|
+
|
|
30
|
+
- name: Create and push git tag
|
|
31
|
+
if: github.ref == 'refs/heads/main'
|
|
32
|
+
run: |
|
|
33
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
34
|
+
git config user.name "github-actions"
|
|
35
|
+
git config user.email "github-actions@github.com"
|
|
36
|
+
if git ls-remote --tags origin | grep -q "refs/tags/v$VERSION"; then
|
|
37
|
+
echo "Tag v$VERSION already exists, skipping."
|
|
38
|
+
else
|
|
39
|
+
git tag "v$VERSION"
|
|
40
|
+
git push origin "v$VERSION"
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
- name: Publish (latest)
|
|
44
|
+
if: github.ref == 'refs/heads/main'
|
|
45
|
+
run: |
|
|
46
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
47
|
+
if npm view "@taruvi/navkit@$VERSION" version 2>/dev/null | grep -q "$VERSION"; then
|
|
48
|
+
echo "Version $VERSION already published, skipping."
|
|
49
|
+
else
|
|
50
|
+
npm publish --access public
|
|
51
|
+
fi
|
|
52
|
+
env:
|
|
53
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
54
|
+
|
|
55
|
+
- name: Publish (beta)
|
|
56
|
+
if: github.ref == 'refs/heads/beta'
|
|
57
|
+
run: |
|
|
58
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
59
|
+
if npm view "@taruvi/navkit@$VERSION" version 2>/dev/null | grep -q "$VERSION"; then
|
|
60
|
+
echo "Version $VERSION already published, skipping."
|
|
61
|
+
else
|
|
62
|
+
npm publish --access public --tag beta
|
|
63
|
+
fi
|
|
64
|
+
env:
|
|
65
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taruvi/navkit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"main": "src/App.tsx",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
8
8
|
"build": "tsc -b && vite build",
|
|
9
|
+
"test": "vitest run",
|
|
9
10
|
"lint": "eslint .",
|
|
10
11
|
"preview": "vite preview"
|
|
11
12
|
},
|
|
@@ -43,7 +44,8 @@
|
|
|
43
44
|
"react-dom": "^19.2.3",
|
|
44
45
|
"typescript": "~5.9.3",
|
|
45
46
|
"typescript-eslint": "^8.45.0",
|
|
46
|
-
"vite": "^7.1.7"
|
|
47
|
+
"vite": "^7.1.7",
|
|
48
|
+
"vitest": "^4.0.18"
|
|
47
49
|
},
|
|
48
50
|
"dependencies": {
|
|
49
51
|
"@taruvi/sdk": "^1.3.4-beta.0"
|
package/src/App.styles.ts
CHANGED
|
@@ -7,13 +7,17 @@ export const appStyles = {
|
|
|
7
7
|
},
|
|
8
8
|
toolbar: {
|
|
9
9
|
backgroundColor: colours.bg.white,
|
|
10
|
+
justifyContent: 'space-between',
|
|
10
11
|
},
|
|
11
12
|
leftSection: {
|
|
12
13
|
display: 'flex',
|
|
13
|
-
flexGrow: 1,
|
|
14
14
|
alignItems: 'center',
|
|
15
15
|
justifyContent: 'start',
|
|
16
16
|
gap: '10px',
|
|
17
|
+
width: 'fit-content',
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
textDecoration: 'none',
|
|
20
|
+
color: 'inherit',
|
|
17
21
|
},
|
|
18
22
|
logo: {
|
|
19
23
|
maxHeight: '40px',
|
|
@@ -74,14 +78,17 @@ export const getAppStyles = (mode: ThemeMode) => {
|
|
|
74
78
|
toolbar: {
|
|
75
79
|
backgroundColor: '#004369',
|
|
76
80
|
boxShadow: ' 0px 0px 10px 2px rgba(0, 0, 0, 0.3)',
|
|
77
|
-
|
|
81
|
+
justifyContent: 'space-between',
|
|
78
82
|
},
|
|
79
83
|
leftSection: {
|
|
80
84
|
display: 'flex',
|
|
81
|
-
flexGrow: 1,
|
|
82
85
|
alignItems: 'center',
|
|
83
86
|
justifyContent: 'start',
|
|
84
87
|
gap: '10px',
|
|
88
|
+
width: 'fit-content',
|
|
89
|
+
cursor: 'pointer',
|
|
90
|
+
textDecoration: 'none',
|
|
91
|
+
color: 'inherit',
|
|
85
92
|
},
|
|
86
93
|
logo: {
|
|
87
94
|
maxHeight: '40px',
|
package/src/App.tsx
CHANGED
|
@@ -18,6 +18,7 @@ const NavkitContent = () => {
|
|
|
18
18
|
const [showShortcutsMenu, setShowShortcutsMenu] = useState<boolean>(false)
|
|
19
19
|
const [showChat, setShowChat] = useState<boolean>(false)
|
|
20
20
|
const [isAppLauncherHovered, setIsAppLauncherHovered] = useState<boolean>(false);
|
|
21
|
+
console.log("testing cicd")
|
|
21
22
|
|
|
22
23
|
return (
|
|
23
24
|
<>
|
|
@@ -33,7 +34,7 @@ const NavkitContent = () => {
|
|
|
33
34
|
)}
|
|
34
35
|
<AppBar position="static" sx={styles.appBar}>
|
|
35
36
|
<Toolbar sx={styles.toolbar}>
|
|
36
|
-
<Box component={"
|
|
37
|
+
<Box component={"a"} href="/" sx={styles.leftSection}>
|
|
37
38
|
{appSettings?.icon ? <Box component="img" src={appSettings?.icon} sx={styles.logo} /> : <></>}
|
|
38
39
|
{appSettings?.displayName &&
|
|
39
40
|
<Typography sx={styles.appName} onClick={() => (window.location.href = "/")}>
|
|
@@ -45,22 +46,22 @@ const NavkitContent = () => {
|
|
|
45
46
|
<Shortcuts showChat={setShowChat} onMenuToggle={() => setShowShortcutsMenu(!showShortcutsMenu)} />
|
|
46
47
|
{isUserAuthenticated && userData && <Profile userData={userData} onClick={() => setShowProfileMenu(!showProfileMenu)} />}
|
|
47
48
|
<Box
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
onClick={() => {
|
|
50
|
+
if (isUserAuthenticated) {
|
|
51
|
+
setShowAppLauncher(!showAppLauncher);
|
|
52
|
+
}
|
|
53
|
+
}}
|
|
54
|
+
onMouseEnter={() => {
|
|
55
|
+
if (isUserAuthenticated) {
|
|
56
|
+
setIsAppLauncherHovered(true);
|
|
57
|
+
}
|
|
58
|
+
}}
|
|
59
|
+
onMouseLeave={() => setIsAppLauncherHovered(false)}
|
|
60
|
+
sx={{
|
|
61
|
+
...styles.appLauncherContainer,
|
|
62
|
+
cursor: isUserAuthenticated ? "pointer" : "default",
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
64
65
|
{(isAppLauncherHovered || showAppLauncher) && isUserAuthenticated ? (
|
|
65
66
|
<Box sx={styles.appLauncherHover}>
|
|
66
67
|
<FontAwesomeIcon icon={["fas", "th"]} style={styles.appLauncherIcon} />
|
|
@@ -74,18 +75,19 @@ const NavkitContent = () => {
|
|
|
74
75
|
</Toolbar>
|
|
75
76
|
</AppBar>
|
|
76
77
|
|
|
77
|
-
{
|
|
78
|
+
{showProfileMenu && (
|
|
78
79
|
<Box>
|
|
79
|
-
<
|
|
80
|
+
<ProfileMenu />
|
|
80
81
|
</Box>
|
|
81
82
|
)}
|
|
82
83
|
|
|
83
|
-
{
|
|
84
|
+
{showAppLauncher && isUserAuthenticated && (
|
|
84
85
|
<Box>
|
|
85
|
-
<
|
|
86
|
+
<AppLauncher />
|
|
86
87
|
</Box>
|
|
87
88
|
)}
|
|
88
89
|
|
|
90
|
+
|
|
89
91
|
{showShortcutsMenu && (
|
|
90
92
|
<Box>
|
|
91
93
|
<ShortcutsMenu showChat={setShowChat} />
|
|
@@ -38,16 +38,17 @@ const Shortcuts = (props: ShortcutsProps) => {
|
|
|
38
38
|
/>
|
|
39
39
|
</Link>
|
|
40
40
|
))}
|
|
41
|
-
{siteSettings.showChat && isUserAuthenticated &&
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
{siteSettings.showChat && isUserAuthenticated &&
|
|
42
|
+
<Link
|
|
43
|
+
key={"chat"}
|
|
44
|
+
onClick={() => showChat?.(true)}
|
|
45
|
+
sx={shortcutsStyles.shortcut}
|
|
46
|
+
>
|
|
47
|
+
<FontAwesomeIcon
|
|
48
|
+
icon={["far", "comment"] as any}
|
|
49
|
+
style={shortcutsStyles.iconStyle}
|
|
50
|
+
/>
|
|
51
|
+
</Link>
|
|
51
52
|
}
|
|
52
53
|
</Box>
|
|
53
54
|
|