Skip to content

Commit 7e49ef2

Browse files
authored
Merge pull request #100 from UW-Macrostrat/package-versions
Upgrade package versions
2 parents 9a0c3e3 + 0500579 commit 7e49ef2

File tree

79 files changed

+2136
-898
lines changed

Some content is hidden

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

79 files changed

+2136
-898
lines changed

.github/workflows/dev.build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Setup node
3131
uses: actions/setup-node@v4
3232
with:
33-
node-version: 18
33+
node-version: 22
3434

3535
- name: Pin react-docgen version
3636
run: yarn add -D [email protected]
@@ -62,4 +62,4 @@ jobs:
6262
--s3-provider=Ceph \
6363
--s3-endpoint="$S3_ENDPOINT" \
6464
--s3-access-key-id="$S3_ACCESS_KEY" \
65-
--s3-secret-access-key="$S3_SECRET_KEY"
65+
--s3-secret-access-key="$S3_SECRET_KEY"

.github/workflows/dev.pr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup node
2727
uses: actions/setup-node@v4
2828
with:
29-
node-version: 18
29+
node-version: 22
3030

3131
- name: Pin react-docgen version
3232
run: yarn add -D [email protected]
@@ -41,4 +41,4 @@ jobs:
4141
4242
- name: Install rclone
4343
run: |
44-
curl https://rclone.org/install.sh | sudo bash
44+
curl https://rclone.org/install.sh | sudo bash

.storybook/docs-container.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { DocsContainer as BaseContainer } from "@storybook/addon-docs";
2-
import { themes } from "@storybook/theming";
1+
import { DocsContainer as BaseContainer } from "@storybook/addon-docs/blocks";
2+
import { themes } from "storybook/theming";
33
import h from "@macrostrat/hyper";
44
import { useEffect, useState } from "react";
55

66
export const DocsContainer = ({ children, context }) => {
77
// Check for body class changes
88
const [dark, setDark] = useState(
9-
document.body.classList.contains("bp5-dark")
9+
document.body.classList.contains("bp5-dark"),
1010
);
1111

1212
useEffect(() => {
@@ -45,6 +45,6 @@ export const DocsContainer = ({ children, context }) => {
4545
theme,
4646
context: ctx1,
4747
},
48-
children
48+
children,
4949
);
5050
};

.storybook/github-link.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/** GitHub link addon for Storybook
2+
* Similar to @kemuridama/storybook-addon-github but compatible with Storybook 9
3+
*/
4+
5+
import { useStorybookApi } from "storybook/manager-api";
6+
import { IconButton } from "storybook/internal/components";
7+
import { GithubIcon } from "@storybook/icons";
8+
import h from "@macrostrat/hyper";
9+
10+
export const ADDON_ID = "@macrostrat/storybook-addon-github" as const;
11+
export const TOOL_ID = `${ADDON_ID}/tool` as const;
12+
export const PARAM_KEY = "githubLink" as const;
13+
14+
export function GithubLink({ active }: { active?: boolean }) {
15+
const api = useStorybookApi();
16+
const currentStoryData = api.getCurrentStoryData();
17+
18+
if (!currentStoryData) {
19+
return null;
20+
}
21+
22+
const url = [
23+
"https://github.com",
24+
"UW-Macrostrat/web-components",
25+
"blob",
26+
"main",
27+
currentStoryData.importPath.replace(/\.\//, ""),
28+
].join("/");
29+
30+
return h(
31+
IconButton,
32+
{ active },
33+
h(
34+
"a",
35+
{ href: url, title: "GitHub", target: "_blank", rel: "noreferrer" },
36+
[h(GithubIcon), " View on GitHub"],
37+
),
38+
);
39+
}

.storybook/main.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import { createRequire } from "node:module";
2+
import { dirname, join } from "node:path";
13
import type { StorybookConfig } from "@storybook/react-vite";
24

5+
const require = createRequire(import.meta.url);
6+
37
export default {
48
// vite
59
stories: [
@@ -10,12 +14,14 @@ export default {
1014
"../packages/**/*.stories.@(mdx|js|jsx|ts|tsx)",
1115
],
1216
addons: [
17+
"@storybook/addon-docs",
1318
"@storybook/addon-links",
14-
"@storybook/addon-essentials",
15-
"@storybook/addon-viewport",
16-
"storybook-dark-mode",
17-
"@kemuridama/storybook-addon-github",
19+
"@vueless/storybook-dark-mode",
1820
],
1921
framework: "@storybook/react-vite",
2022
docs: {},
2123
} as StorybookConfig;
24+
25+
function getAbsolutePath(value: string): any {
26+
return dirname(require.resolve(join(value, "package.json")));
27+
}

.storybook/manager.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
import { addons } from "@storybook/manager-api";
1+
import { addons, types } from "storybook/manager-api";
2+
import { GithubLink, ADDON_ID, TOOL_ID } from "./github-link";
3+
import h from "@macrostrat/hyper";
4+
25
import yourTheme from "./theme";
36

47
addons.setConfig({
58
theme: yourTheme,
69
});
10+
11+
// Register the addon
12+
addons.register(ADDON_ID, () => {
13+
// Register the tool
14+
addons.add(TOOL_ID, {
15+
type: types.TOOL,
16+
title: "GitHub",
17+
match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),
18+
render: ({ active }) => h(GithubLink, { active }),
19+
});
20+
});

.storybook/preview.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import "@blueprintjs/core/lib/css/blueprint.css";
2-
import { themes } from "@storybook/theming";
2+
import { themes } from "storybook/theming";
33

44
import { FocusStyleManager, HotkeysProvider } from "@blueprintjs/core";
55
import h from "@macrostrat/hyper";
66
import "@macrostrat/style-system/src/main.sass";
77
import { DarkModeProvider } from "@macrostrat/ui-components";
8-
import { useDarkMode } from "storybook-dark-mode";
8+
import { useDarkMode } from "@vueless/storybook-dark-mode";
99
import { DocsContainer } from "./docs-container";
1010
import { GeologicPatternProvider } from "@macrostrat/column-components";
1111

@@ -48,18 +48,14 @@ export const parameters = {
4848
},
4949
},
5050
},
51-
github: {
52-
repository: "UW-Macrostrat/web-components",
53-
branch: "main",
54-
},
5551
};
5652

5753
export const decorators = [
5854
(renderStory) => {
5955
const isEnabled = useDarkMode();
6056
return h(
6157
PatternProvider,
62-
h(DarkModeProvider, { isEnabled }, renderStory())
58+
h(DarkModeProvider, { isEnabled }, renderStory()),
6359
);
6460
},
6561
];

.storybook/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { create } from "@storybook/theming";
1+
import { create } from "storybook/theming";
22

33
export default create({
44
base: "light",

examples/strat-column/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"devDependencies": {
1212
"@types/react": "^18.3.12",
1313
"@types/react-dom": "^18",
14-
"typescript": "^5.0.0",
14+
"typescript": "^5.8.3",
1515
"vite": "^5.3.2",
1616
"vite-plugin-serve-static": "^1.1.0"
1717
},

package.json

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@macrostrat/web-components",
33
"description": "Web components for stratigraphy and geologic mapping managed by Macrostrat",
44
"private": true,
5+
"type": "module",
56
"repository": "https://github.com/UW-Macrostrat/web-components.git",
67
"version": "3.0.0",
78
"scripts": {
@@ -15,7 +16,6 @@
1516
"check-types": "tsc --noEmit",
1617
"check-circular": "madge --circular --extensions ts,tsx ."
1718
},
18-
"type": "module",
1919
"author": "Daven Quinn",
2020
"license": "ISC",
2121
"dependencies": {
@@ -24,25 +24,19 @@
2424
"@babel/preset-typescript": "^7.21.4",
2525
"@blueprintjs/core": "^5.10.2",
2626
"@macrostrat/hyper": "^3.0.6",
27+
"@mdx-js/rollup": "^3.1.0",
2728
"@parcel/bundler-library": "^2.14.4",
2829
"@parcel/config-default": "^2.14.4",
2930
"@parcel/transformer-sass": "^2.14.4",
3031
"@parcel/transformer-typescript-types": "^2.14.4",
31-
"@storybook/addon-actions": "^8.6.8",
32-
"@storybook/addon-docs": "^8.6.8",
33-
"@storybook/addon-essentials": "^8.6.8",
34-
"@storybook/addon-links": "^8.6.8",
35-
"@storybook/addon-viewport": "^8.6.8",
36-
"@storybook/builder-vite": "^8.6.8",
37-
"@storybook/components": "^8.6.8",
38-
"@storybook/manager-api": "^8.6.8",
39-
"@storybook/preview-api": "^8.6.8",
40-
"@storybook/react": "^8.6.8",
41-
"@storybook/react-vite": "^8.6.8",
42-
"@storybook/theming": "^8.6.8",
32+
"@storybook/addon-docs": "9.0.12",
33+
"@storybook/addon-links": "9.0.12",
34+
"@storybook/builder-vite": "9.0.12",
35+
"@storybook/react-vite": "9.0.12",
4336
"@types/d3-geo": "^3.1.0",
4437
"@types/geojson": "^7946.0.16",
4538
"@types/react": "^18.3.12",
39+
"@vueless/storybook-dark-mode": "^9.0.5",
4640
"chalk": "^5.0.1",
4741
"date-fns": "^4.1.0",
4842
"glob": "^11.0.1",
@@ -51,22 +45,21 @@
5145
"marked-terminal": "^7.1.0",
5246
"node-fetch": "^3.2.9",
5347
"parcel": "^2.14.4",
54-
"prettier": "^2.7.1",
55-
"react": "^18",
56-
"react-dom": "^18",
48+
"prettier": "^3.6.1",
49+
"react": "^19",
50+
"react-dom": "^19",
5751
"sass-embedded": "^1.83.0",
58-
"storybook": "^8.6.8",
59-
"storybook-dark-mode": "^4.0.2",
52+
"storybook": "9.0.12",
6053
"tsx": "^4.19.1",
61-
"typescript": "^5.6.2",
54+
"typescript": "^5.8.3",
6255
"underscore": "^1.12.0",
6356
"use-async-effect": "^2.2.1",
64-
"vite": "^5.4.11"
57+
"vite": "^6.1.6"
6558
},
6659
"resolutions": {
6760
"@types/react": "18.3.12",
68-
"react": "^18.3.1",
69-
"react-dom": "^18.3.1"
61+
"react": "^19",
62+
"react-dom": "^19"
7063
},
7164
"workspaces": [
7265
"packages/*",
@@ -75,11 +68,11 @@
7568
],
7669
"packageManager": "[email protected]",
7770
"devDependencies": {
78-
"@kemuridama/storybook-addon-github": "^1.4.0",
7971
"@parcel/packager-ts": "^2.14.4",
8072
"@types/d3-array": "^3.2.1",
8173
"@types/underscore": "^1.13.0",
8274
"madge": "^8.0.0",
75+
"prettier": "^3.6.1",
8376
"react-docgen": "7.0.0"
8477
}
8578
}

0 commit comments

Comments
 (0)