Skip to content

Commit

Permalink
Merge branch 'hoist-pages-dir' into streamline-renderer
Browse files Browse the repository at this point in the history
* hoist-pages-dir:
  Change import prefix for page routes
  Hoisted pages directory
  • Loading branch information
davenquinn committed Jul 21, 2024
2 parents ec209b7 + fb38d17 commit ac03069
Show file tree
Hide file tree
Showing 382 changed files with 378 additions and 372 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/pages/+Layout.ts → pages/+Layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { AuthProvider } from "~/_providers/auth";
import { usePageContext } from "vike-react/usePageContext";

import "~/styles/blueprint-core";
import "../styles/_theme.styl";
import "../styles/core.sass";
import "../styles/padding.css";
import "~/styles/_theme.styl";
import "~/styles/core.sass";
import "~/styles/padding.css";
//
import h from "./layout.module.sass";

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { apiV2Prefix } from "@macrostrat-web/settings";
import { preprocessUnits } from "@macrostrat/column-views/src/helpers";
import fetch from "node-fetch";

import { ColumnSummary } from "~/pages/map/map-interface/app-state/handlers/columns";
import { fetchAPIData } from "~/pages/columns/utils";
import { ColumnSummary } from "#/map/map-interface/app-state/handlers/columns";
import { fetchAPIData } from "#/columns/utils";

export async function onBeforeRender(pageContext) {
// `.page.server.js` files always run in Node.js; we could use SQL/ORM queries here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
UnitSelectionProvider,
useSelectedUnit,
} from "@macrostrat/column-views";
import { UnitDescription } from "~/pages/columns/correlation/column";
import { UnitDescription } from "#/columns/correlation/column";

export function Page() {
const startup = useCorrelationDiagramStore((state) => state.startup);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
LegendPanelHeader,
UnitDetailsPopover,
} from "~/components/unit-details";
import { useCorrelationDiagramStore } from "~/pages/columns/correlation/state";
import { useCorrelationDiagramStore } from "#/columns/correlation/state";

export function MacrostratColumnProvider(props) {
// A column provider specialized the Macrostrat API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {
preprocessUnits,
useUnitSelectionDispatch,
} from "@macrostrat/column-views";
import { runColumnQuery } from "~/pages/map/map-interface/app-state/handlers/fetch";
import { runColumnQuery } from "#/map/map-interface/app-state/handlers/fetch";
import { Column, TimescaleColumn } from "./column";
import { UnitLong } from "@macrostrat/api-types";
import { GapBoundPackage, SectionRenderData, AgeComparable } from "./types";

import h from "./main.module.sass";
import { useCorrelationDiagramStore } from "~/pages/columns/correlation/state";
import { useCorrelationDiagramStore } from "#/columns/correlation/state";

export interface ColumnIdentifier {
col_id: number;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LineString, Point } from "geojson";
import { create } from "zustand";
import { ColumnGeoJSONRecord } from "~/pages/map/map-interface/app-state/handlers/columns";
import { ColumnGeoJSONRecord } from "#/map/map-interface/app-state/handlers/columns";
// Turf intersection
import { fetchAllColumns } from "~/pages/map/map-interface/app-state/handlers/fetch";
import { fetchAllColumns } from "#/map/map-interface/app-state/handlers/fetch";
import {
getCorrelationHashParams,
setHashStringForCorrelation,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
FeatureSelectionHandler,
} from "@macrostrat/map-interface";
import { NonIdealState } from "@blueprintjs/core";
import { LinkItem } from "~/pages/map/dev/map-layers";
import { LinkItem } from "#/map/dev/map-layers";
import { Link } from "~/components";

export function Page() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ import { useMapRef } from "@macrostrat/mapbox-react";
import { useDarkMode } from "@macrostrat/ui-components";
import { useEffect, useMemo, useState } from "react";
import { useSelector } from "react-redux";
import {
useAppActions,
useAppState,
} from "~/pages/map/map-interface/app-state";
import { useAppActions, useAppState } from "#/map/map-interface/app-state";
import { MacrostratRasterTileset, buildRasterStyle, h } from ".";
import { useMapStyle } from "./utils";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SETTINGS, apiV2Prefix } from "@macrostrat-web/settings";
import axios from "axios";
import { joinURL } from "~/pages/map/map-interface/utils";
import { joinURL } from "#/map/map-interface/utils";
import { ColumnGeoJSONRecord } from "./columns";
import { UPDATE_COLUMN_FILTERS } from "../reducers/core/types";
import { XDDSnippet } from "~/types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
AppState,
AppAction,
MenuPage,
} from "~/pages/map/map-interface/app-state";
import { AppState, AppAction, MenuPage } from "#/map/map-interface/app-state";
import { push, UpdateLocationAction } from "@lagunovsky/redux-react-router";
import { LineString } from "geojson";
import { mapPagePrefix, routerBasename } from "@macrostrat-web/settings";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import hyper from "@macrostrat/hyper";
import classNames from "classnames";
import { useInView } from "react-intersection-observer";
import { HashLink } from "react-router-hash-link";
import { joinURL } from "~/pages/map/map-interface/utils";
import { joinURL } from "#/map/map-interface/utils";
import styles from "./docs.module.styl";

const h = hyper.styled(styles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { scaleLinear } from "d3-scale";
import { mouse, select } from "d3-selection";
import { area, line } from "d3-shape";
import React, { useEffect, useRef } from "react";
import {
useAppActions,
useAppState,
} from "~/pages/map/map-interface/app-state";
import { useAppActions, useAppState } from "#/map/map-interface/app-state";

import { apiV2Prefix } from "@macrostrat-web/settings";
import styles from "./main.module.styl";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import React, { useState } from "react";
import hyper from "@macrostrat/hyper";
import { Tag, Card, Button, Collapse, Switch } from "@blueprintjs/core";
import {
useAppActions,
useAppState,
} from "~/pages/map/map-interface/app-state";
import { useAppActions, useAppState } from "#/map/map-interface/app-state";
import { useAdmoinshments } from "./admonishments";
import styles from "./filters.module.styl";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import h from "@macrostrat/hyper";
import { ExpansionPanel } from "@macrostrat/map-interface";
import LongText from "../long-text";
import { IntervalChip } from "../info-blocks";
import { useAppActions } from "~/pages/map/map-interface/app-state";
import { useAppActions } from "#/map/map-interface/app-state";
import { MapReference } from "~/components/map-info";

function LongTextRenderer(props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import hyper from "@macrostrat/hyper";
import { Route, Routes } from "react-router-dom";
import { useAppActions } from "~/pages/map/map-interface/app-state";
import { useAppActions } from "#/map/map-interface/app-state";
import { LocationPanel } from "@macrostrat/map-interface";
import { FossilCollections } from "./fossil-collections";
import { GeologicMapInfo } from "./geo-map";
import { MacrostratLinkedData } from "./macrostrat-linked";
import { RegionalStratigraphy } from "./reg-strat";
import { Physiography } from "./physiography";
import { XddExpansion } from "./xdd-panel";
import { useAppState } from "~/pages/map/map-interface/app-state";
import { useAppState } from "#/map/map-interface/app-state";
import styles from "./main.module.styl";
import { LoadingArea } from "../transitions";
import { StratColumn } from "./strat-column";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import h from "@macrostrat/hyper";
import { ExpansionPanel } from "@macrostrat/map-interface";
import { addCommas } from "~/pages/map/map-interface/utils";
import { useAppState } from "~/pages/map/map-interface/app-state";
import { addCommas } from "#/map/map-interface/utils";
import { useAppState } from "#/map/map-interface/app-state";
import { Spinner } from "@blueprintjs/core";
import { Link } from "react-router-dom";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { UnitLong } from "@macrostrat/api-types";
//import "@macrostrat/column-components/src/main.module.scss";

import styles from "./strat-column.module.styl";
import { ColumnSummary } from "~/pages/map/map-interface/app-state/handlers/columns";
import { ColumnSummary } from "#/map/map-interface/app-state/handlers/columns";
import { NonIdealState } from "@blueprintjs/core";
import useBreadcrumbs from "use-react-router-breadcrumbs";
import { LinkButton } from "../../buttons";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Article from "./Article";
import { Divider } from "@blueprintjs/core";
import h from "@macrostrat/hyper";
import { SubExpansionPanel } from "@macrostrat/map-interface";
import { XDDSnippet } from "~/pages/map/map-interface/app-state/handlers/fetch";
import { XDDSnippet } from "#/map/map-interface/app-state/handlers/fetch";

function Journal(props) {
return h("div.journal", [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import { Spinner } from "@blueprintjs/core";
import h from "@macrostrat/hyper";
import Journal from "./Journal";
import { ExpansionPanel } from "@macrostrat/map-interface";
import {
useAppActions,
useAppState,
} from "~/pages/map/map-interface/app-state";
import { XDDSnippet } from "~/pages/map/map-interface/app-state/handlers/fetch";
import { useAppActions, useAppState } from "#/map/map-interface/app-state";
import { XDDSnippet } from "#/map/map-interface/app-state/handlers/fetch";

export function XddExpansion() {
const runAction = useAppActions();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MapLayer } from "~/pages/map/map-interface/app-state";
import { MapLayer } from "#/map/map-interface/app-state";
import { Component } from "react";

class VestigialMap extends Component<MapProps, {}> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMapRef, useMapStatus } from "@macrostrat/mapbox-react";
import { useEffect, useRef } from "react";
import { useAppState } from "~/pages/map/map-interface/app-state";
import { useAppState } from "#/map/map-interface/app-state";
import { LineString } from "geojson";
import { GeoJSONSource } from "mapbox-gl";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FeatureCollection, Point } from "geojson";
import {
FilterData,
IntervalFilterData,
} from "~/pages/map/map-interface/app-state/handlers/filters";
} from "#/map/map-interface/app-state/handlers/filters";

export function getExpressionForFilters(
filters: FilterData[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
MapLayer,
useAppActions,
useAppState,
} from "~/pages/map/map-interface/app-state";
} from "#/map/map-interface/app-state";
import styles from "../main.module.styl";
import { CrossSectionLine } from "./cross-section";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import {
AppAction,
MapLayer,
useAppActions,
} from "~/pages/map/map-interface/app-state";
import { ColumnProperties } from "~/pages/map/map-interface/app-state/handlers/columns";
} from "#/map/map-interface/app-state";
import { ColumnProperties } from "#/map/map-interface/app-state/handlers/columns";
import {
useMapRef,
useMapStatus,
useMapStyleOperator,
} from "@macrostrat/mapbox-react";
import { useEffect, useRef, useCallback } from "react";
import { useAppState } from "~/pages/map/map-interface/app-state";
import { useAppState } from "#/map/map-interface/app-state";
import { getExpressionForFilters } from "./filter-helpers";

interface MapProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hyper from "@macrostrat/hyper";
import { useEffect } from "react";
import { MapBottomControls } from "@macrostrat/map-interface";
import { LinkButton } from "~/pages/map/map-interface/components/buttons";
import { LinkButton } from "#/map/map-interface/components/buttons";
import styles from "../main.module.styl";

const h = hyper.styled(styles);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
MapLayer,
useAppActions,
useAppState,
} from "~/pages/map/map-interface/app-state";
} from "#/map/map-interface/app-state";

import h from "./settings-panel.module.styl";

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from "react";
import { useBurwellActions } from "~/pages/map/sources/app-state";
import { useBurwellActions } from "#/map/sources/app-state";
import hyper from "@macrostrat/hyper";
import IndexMapContainer from "./map";
import { InfoDrawer } from "./info-drawer";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import h from "@macrostrat/hyper";
import { ExpansionPanel } from "@macrostrat/map-interface";
import { Link } from "~/components";
import { useBurwellActions } from "~/pages/map/sources/app-state";
import { useBurwellActions } from "#/map/sources/app-state";
import { zoomMap } from "../app-state/utils";

function FeatureTable(props) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
flyToData,
useBurwellActions,
useBurwellState,
} from "~/pages/map/sources/app-state";
} from "#/map/sources/app-state";
import { initializeMap } from "./initialize-map";
import { mapSources } from "./map-sources";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import {
Switch,
} from "@blueprintjs/core";
import h from "@macrostrat/hyper";
import {
useBurwellActions,
useBurwellState,
} from "~/pages/map/sources/app-state";
import { useBurwellActions, useBurwellState } from "#/map/sources/app-state";

const capitalizeWord = (word) => {
return word.charAt(0).toUpperCase() + word.slice(1);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ac03069

Please sign in to comment.