Skip to content

Commit 1740c01

Browse files
committed
Merge branch 'prepare-for-publishing'
* prepare-for-publishing: (153 commits) Fixed types etc. so that column-views is publishable Update changelogs and versions fixed state management Fix some typescript errors Fixed some small typescript errors Fixed a ton of typescript errors Sovlved some typing issues Solved some small typing errors Remove circular imports from column-views package Small updates to stories Updated style system exports Rename publish script Simplify storybook dependencies and update Yarn Add upload script Improved correlation diagram styling Correlation diagram now mostly works like normal column Cleverly align preparation of correlation diagram with single-column prep Updated accounting for correlation chart Update packages calculation Remove redundant AgeScaleMode ...
2 parents 7ac2285 + 4290a56 commit 1740c01

File tree

164 files changed

+10255
-3093
lines changed

Some content is hidden

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

164 files changed

+10255
-3093
lines changed

.storybook/main.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
1-
import { dirname, join } from "path";
21
import type { StorybookConfig } from "@storybook/react-vite";
32

4-
// Resolve geologic patterns from the package
5-
// If we're using PnP mode, we have to have an "unplugged" version of the package
6-
// to allow node_modules to be resolved.
7-
const geologicPatterns = dirname(require.resolve("geologic-patterns"));
8-
93
export default {
104
// vite
115
stories: [
6+
"../stories/**/*.@(mdx|js|jsx|ts|tsx)",
127
"../packages/*/src/**/*.mdx",
138
"../packages/*/stories/*.mdx",
149
"../packages/**/*.stories.@(mdx|js|jsx|ts|tsx)",
1510
],
16-
staticDirs: [
17-
{
18-
from: join(geologicPatterns, "assets/svg"),
19-
to: "/patterns",
20-
},
21-
],
2211
addons: [
2312
"@storybook/addon-links",
2413
"@storybook/addon-essentials",

.storybook/preview.ts

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import "@blueprintjs/core/lib/css/blueprint.css";
22
import { themes } from "@storybook/theming";
3-
import macrostratTheme from "./theme";
43

54
import { FocusStyleManager } from "@blueprintjs/core";
65
import h from "@macrostrat/hyper";
7-
import "@macrostrat/style-system";
6+
import "@macrostrat/style-system/src/main.sass";
87
import { DarkModeProvider } from "@macrostrat/ui-components";
98
import { useDarkMode } from "storybook-dark-mode";
109
import { DocsContainer } from "./docs-container";
10+
import { GeologicPatternProvider } from "@macrostrat/column-components";
1111

1212
FocusStyleManager.onlyShowFocusOnTabs();
1313

@@ -34,13 +34,38 @@ export const parameters = {
3434
lightClass: [],
3535
stylePreview: true,
3636
},
37+
parameters: {
38+
options: {
39+
storySort: {
40+
order: [
41+
"Web components",
42+
"Map interface",
43+
"Column views",
44+
"Timescale",
45+
"Column components",
46+
],
47+
},
48+
},
49+
},
3750
};
3851

3952
export const decorators = [
4053
(renderStory) => {
4154
const isEnabled = useDarkMode();
42-
return h(DarkModeProvider, { isEnabled }, renderStory());
55+
return h(
56+
PatternProvider,
57+
h(DarkModeProvider, { isEnabled }, renderStory())
58+
);
4359
},
4460
];
4561

4662
export const tags = ["autodocs"];
63+
64+
function PatternProvider({ children }) {
65+
return h(GeologicPatternProvider, {
66+
resolvePattern(id: string) {
67+
return `https://dev2.macrostrat.org/assets/geologic-patterns/svg/${id}.svg`;
68+
},
69+
children,
70+
});
71+
}
Lines changed: 346 additions & 345 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
packageExtensions:
2-
debug@*:
3-
dependencies:
4-
supports-color: "*"
5-
follow-redirects@*:
6-
dependencies:
7-
debug: "*"
82
"@blueprintjs/datetime@*":
93
dependencies:
10-
"@types/react": "^16||^17||^18"
4+
"@types/react": ^16||^17||^18
115
"@parcel/fs@^2.13.3":
126
dependencies:
13-
"@parcel/core": "^2.13.3"
7+
"@parcel/core": ^2.13.3
148
"@parcel/workers@^2.13.3":
159
dependencies:
16-
"@parcel/core": "^2.13.3"
17-
"node-fetch@*":
10+
"@parcel/core": ^2.13.3
11+
"@types/react@*":
12+
dependencies:
13+
prop-types: "*"
14+
debug@*:
15+
dependencies:
16+
supports-color: "*"
17+
follow-redirects@*:
18+
dependencies:
19+
debug: "*"
20+
node-fetch@*:
1821
dependencies:
1922
"@types/node": "*"
20-
"ui-box@*":
23+
ui-box@*:
2124
dependencies:
2225
"@types/prop-types": "*"
23-
"csstype": "*"
24-
"@types/react@*":
25-
dependencies:
26-
"prop-types": "*"
27-
28-
# We could make this stricter if we wanted to ensure correctness
29-
# https://yarnpkg.com/configuration/yarnrc
26+
csstype: "*"
3027

3128
pnpFallbackMode: all
29+
3230
pnpMode: loose
3331

34-
yarnPath: .yarn/releases/yarn-4.6.0.cjs
32+
yarnPath: .yarn/releases/yarn-4.8.1.cjs

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,11 @@ yarn up -i <package-name>
128128
```sh
129129
yarn why @macrostrat/column-components
130130
```
131+
132+
#### Find circular dependencies
133+
134+
Circular dependencies prevent building and Vite compilation in some cases
135+
136+
```sh
137+
yarn dlx madge --circular --extensions ts packages/column-views
138+
```

package.json

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"status": "NODE_NO_WARNINGS=1 tsx scripts/publish-helpers status",
1212
"prepare": "NODE_NO_WARNINGS=1 tsx scripts/publish-helpers prepare",
1313
"publish": "NODE_NO_WARNINGS=1 tsx scripts/publish-helpers publish",
14-
"check": "tsc --noEmit"
14+
"publish:storybook": "./scripts/publish-storybook.sh",
15+
"check-types": "tsc --noEmit",
16+
"check-circular": "madge --circular --extensions ts,tsx ."
1517
},
1618
"type": "module",
1719
"author": "Daven Quinn",
@@ -26,25 +28,24 @@
2628
"@parcel/config-default": "^2.13.3",
2729
"@parcel/transformer-sass": "^2.13.3",
2830
"@parcel/transformer-typescript-types": "^2.13.3",
29-
"@storybook/addon-actions": "^8.5.3",
30-
"@storybook/addon-docs": "^8.5.3",
31-
"@storybook/addon-essentials": "^8.5.3",
32-
"@storybook/addon-links": "^8.5.3",
33-
"@storybook/addon-viewport": "^8.5.3",
34-
"@storybook/builder-vite": "^8.5.3",
35-
"@storybook/components": "^8.5.3",
36-
"@storybook/manager-api": "^8.5.3",
37-
"@storybook/preview-api": "^8.5.3",
38-
"@storybook/react": "^8.5.3",
39-
"@storybook/react-vite": "^8.5.3",
40-
"@storybook/theming": "^8.5.3",
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",
4143
"@types/d3-geo": "^2.0.0",
4244
"@types/geojson": "^7946.0.7",
4345
"@types/react": "^18.3.12",
4446
"chalk": "^5.0.1",
4547
"concurrently": "^7.2.2",
4648
"date-fns": "^4.1.0",
47-
"geologic-patterns": "^2.0.0-dev1",
4849
"glob": "^11.0.1",
4950
"lorem-ipsum": "^2.0.8",
5051
"marked": "^11.0",
@@ -55,7 +56,7 @@
5556
"react": "^18",
5657
"react-dom": "^18",
5758
"sass-embedded": "^1.83.0",
58-
"storybook": "^8.5.3",
59+
"storybook": "^8.6.8",
5960
"storybook-dark-mode": "^4.0.2",
6061
"tsx": "^4.19.1",
6162
"typescript": "^5.6.2",
@@ -71,15 +72,11 @@
7172
"toolchain/*",
7273
"examples/*"
7374
],
74-
"packageManager": "[email protected]",
75-
"dependenciesMeta": {
76-
77-
"unplugged": true
78-
}
79-
},
75+
"packageManager": "[email protected]",
8076
"devDependencies": {
8177
"@parcel/packager-ts": "2.13.3",
8278
"@types/d3-array": "^3.2.1",
83-
"@types/underscore": "^1.13.0"
79+
"@types/underscore": "^1.13.0",
80+
"madge": "^8.0.0"
8481
}
8582
}

packages/api-types/CHANGELOG.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
and this project adheres to
7+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8+
9+
## [1.1.0] - 2025-04-09
10+
11+
- Add types for `Environment`, `Lithology`, `MacrostratRef`, and
12+
`ColumnGeoJSONRecord`
13+
- Improve types for `UnitLong`
14+
- Add a `UnitLongFull` type to allow access to deprecated fields
715

816
## [1.0.0] - 2025-02-14
917

10-
First public release of the API types package, including types for columns, units and measurements
11-
for Macrostrat's v2 API.
18+
First public release of the API types package, including types for columns,
19+
units and measurements for Macrostrat's v2 API.

packages/api-types/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@macrostrat/api-types",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "Type definitions for Macrostrat's API",
55
"main": "./src/index.d.ts",
66
"types": "./src/index.d.ts",
@@ -20,5 +20,8 @@
2020
},
2121
"devDependencies": {
2222
"parcel": "^2.13.3"
23+
},
24+
"dependencies": {
25+
"@types/geojson": "^7946.0.16"
2326
}
2427
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1+
import { Polygon, MultiPolygon } from "geojson";
2+
13
export type ColumnSpec = {
24
col_id: number | string;
35
status_code?: string;
46
project_id?: number;
57
};
8+
9+
export type ColumnProperties = {
10+
col_id: number;
11+
col_area: string;
12+
col_name: string;
13+
col_group?: string;
14+
col_group_id?: number;
15+
project_id: number;
16+
group_col_id?: number;
17+
};
18+
19+
export interface ColumnGeoJSONRecord {
20+
type: "Feature";
21+
geometry: Polygon | MultiPolygon;
22+
properties: ColumnProperties;
23+
}
24+
25+
export interface ColumnGeoJSONRecordWithID extends ColumnGeoJSONRecord {
26+
id: number;
27+
}

packages/api-types/src/defs.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/** References:
2+
* /defs/refs
3+
*
4+
* Example: {
5+
* ref_id: 1,
6+
* pub_year: 1985,
7+
* author: "Childs, O.E.",
8+
* ref: "Correlation of stratigraphic units of North America; COSUNA. AAPG Bulletin 69:173-180.",
9+
* doi: null,
10+
* url: null,
11+
* t_units: 17045,
12+
* };
13+
*
14+
*/
15+
16+
export interface MacrostratRef {
17+
ref_id: number;
18+
pub_year: number;
19+
author: string;
20+
ref: string;
21+
doi: string | null;
22+
url: string | null;
23+
t_units: number;
24+
}

0 commit comments

Comments
 (0)