Skip to content

Commit ad9e8a4

Browse files
committed
Merge branch 'main' into feat-publish-veda-ui-to-npm
2 parents aa7292b + dc22232 commit ad9e8a4

File tree

18 files changed

+329
-218
lines changed

18 files changed

+329
-218
lines changed

.release-it.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
const prefixes = {
2+
feat: '🎉 Features',
3+
fix: '🐛 Fixes',
4+
docs: '🚀 Improvements',
5+
ci: '🚀 Improvements',
6+
test: '🚀 Improvements',
7+
refactor: '🚀 Improvements',
8+
chore: '🚀 Improvements',
9+
revert: '🐛 Fixes'
10+
};
11+
12+
function groupCommitsByCategory(logs) {
13+
const grouped = {};
14+
15+
// Initialize categories from the values in the prefixes dictionary
16+
Object.values(prefixes).forEach((category) => {
17+
grouped[category] = [];
18+
});
19+
20+
// Loop through each prefix to find conventional commit pattern ex. feat: , feat(card):
21+
Object.entries(prefixes).forEach(([prefix, category]) => {
22+
const regex = new RegExp(`^\\* ${prefix}(\\(.*?\\))?: .*?\\)$`, 'gm');
23+
const matches = logs.match(regex) || [];
24+
grouped[category] = [...matches, ...grouped[category]];
25+
});
26+
27+
return grouped;
28+
}
29+
30+
module.exports = {
31+
hooks: {
32+
'after:release': 'echo "VERSION_NUMBER=v${version}" >> "$GITHUB_OUTPUT" '
33+
},
34+
git: {
35+
commitMessage: 'chore(release): update to version v${version}',
36+
tagName: 'v${version}',
37+
tagAnnotation: 'Release v${version}',
38+
pushArgs: ['--follow-tags'],
39+
getLatestTagFromAllRefs: true
40+
},
41+
npm: {
42+
publish: false
43+
},
44+
github: {
45+
release: true,
46+
releaseName: 'v${version}',
47+
autoGenerate: false,
48+
releaseNotes: function (context) {
49+
const groupedCommits = groupCommitsByCategory(context.changelog);
50+
const changelog = Object.entries(groupedCommits)
51+
.map(([prefix, commits]) => {
52+
if (commits.length > 0) {
53+
return `## What's changed \n ### ${prefix}\n ${commits.join('\n')}`;
54+
}
55+
})
56+
.join('\n');
57+
58+
return changelog;
59+
}
60+
},
61+
plugins: {
62+
// The @release-it/conventional-changelog plugin is primarily used for handling version bumps
63+
// because we encountered difficulties generating GitHub release notes with the plugin.
64+
'@release-it/conventional-changelog': {
65+
preset: 'conventionalcommits'
66+
}
67+
}
68+
};

.release-it.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/scripts/components/common/blocks/scrollytelling/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ function Scrollytelling(props) {
359359

360360
return (
361361
<>
362-
<ScrollyMapContainer topOffset={topOffset}>
362+
<ScrollyMapContainer topOffset={topOffset || 0}>
363363
{areLayersLoading && <MapLoading />}
364364

365365
{/*

app/scripts/components/common/card-sources.tsx renamed to app/scripts/components/common/card-sources-list.tsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from 'react';
22
import styled from 'styled-components';
33
import { listReset } from '@devseed-ui/theme-provider';
4-
import { LinkProperties, TaxonomyItem } from '$types/veda';
4+
import { useVedaUI } from '$context/veda-ui-provider';
5+
import { TaxonomyItem } from '$types/veda';
6+
57
import { FilterActions } from '$components/common//catalog/utils';
68

79
const SourcesUl = styled.ul`
@@ -20,18 +22,19 @@ const SourcesUl = styled.ul`
2022

2123
interface SourcesListProps {
2224
sources?: TaxonomyItem[];
23-
onSourceClick?: (v: string) => void;
25+
onSourceClick?: (sourceId: string) => void;
2426
rootPath?: string;
25-
linkProperties?: LinkProperties;
2627
}
2728

2829
export function CardSourcesList(props: SourcesListProps) {
29-
const { sources, onSourceClick, linkProperties, rootPath } = props;
30-
const { LinkElement, pathAttributeKeyName } = linkProperties as { LinkElement: React.ElementType, pathAttributeKeyName: string };
30+
const { sources, rootPath, onSourceClick } = props;
31+
32+
const { Link } = useVedaUI();
33+
3134
if (!sources?.length) return null;
3235

3336
// No link rendering
34-
if (!rootPath || !onSourceClick) {
37+
if (!rootPath) {
3538
return (
3639
<div>
3740
<span>By</span>{' '}
@@ -50,22 +53,24 @@ export function CardSourcesList(props: SourcesListProps) {
5053
<SourcesUl>
5154
{sources.map((source) => (
5255
<li key={source.id}>
53-
<LinkElement
54-
{...{[pathAttributeKeyName]:`${rootPath}?${FilterActions.TAXONOMY}=${encodeURIComponent(
56+
<Link
57+
to={`${rootPath}?${FilterActions.TAXONOMY}=${encodeURIComponent(
5558
JSON.stringify({
5659
Source: source.id
5760
})
58-
)}`}}
61+
)}`}
5962
onClick={(e) => {
60-
e.preventDefault();
61-
onSourceClick(source.id);
63+
if (onSourceClick) {
64+
e.preventDefault();
65+
onSourceClick(source.id);
66+
}
6267
}}
6368
>
6469
{source.name}
65-
</LinkElement>
70+
</Link>
6671
</li>
6772
))}
6873
</SourcesUl>
6974
</div>
7075
);
71-
}
76+
}

0 commit comments

Comments
 (0)