Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
davenquinn authored Jun 6, 2024
2 parents 12ed960 + 916a21d commit e9ee49f
Show file tree
Hide file tree
Showing 257 changed files with 93,956 additions and 5,193 deletions.
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Build Development
name: Build image

on:
push:
branches: ["main"]
tags:
- v[0-9]+.[0-9]+.[0-9]+ # Semver Release (non-prerelease)
pull_request:
branches: [main]

Expand All @@ -19,15 +21,20 @@ jobs:
uses: docker/metadata-action@v4
with:
images: hub.opensciencegrid.org/macrostrat/web
# New: apply the 'latest' tag to non-prerelease semver tags
tags: |
type=semver,pattern={{version}}
type=raw,value=sha-{{sha}}
type=raw,value=latest-itb
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')}}
type=raw,value=latest-itb-{{date 'YYYYMMDDHHmmss'}}
type=ref,event=pr,suffix=-{{date 'YYYYMMDDHHmmss'}}
type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmmss'}}
type=ref,event=tag,suffix=-{{date 'YYYYMMDDHHmmss'}}
type=raw,value=latest-itb-{{date 'YYYYMMDDHHmmss'}}
type=raw,value=sha-{{sha}}
- name: Set up Docker Buildx
type=semver,pattern={{version}}
type=semver,pattern={{version}}-{{date 'YYYYMMDDHHmmss'}}
flavor: |
latest=false
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v2
- name: Login to OSG DockerHub
uses: docker/login-action@v2
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/build-prod.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/test-build.yaml

This file was deleted.

25 changes: 19 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
"**/.pnp.*": true,
".vite": true,
"node_modules": true,
"dist": true
},
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
// Disable organized imports for typescript
"[typescript]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "never"
}
"cSpell.enableFiletypes": [
"!javascript",
"!javascriptreact",
"!json",
"!scss",
"!typescript"
],
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/__pycache__": true
}
}
17 changes: 12 additions & 5 deletions .yarn/sdks/typescript/lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserver.js
require(absPnpApiPath).setup();
}
}

const moduleWrapper = tsserver => {
if (!process.versions.pnp) {
return tsserver;
Expand Down Expand Up @@ -214,11 +221,11 @@ const moduleWrapper = tsserver => {
return tsserver;
};

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserver.js
require(absPnpApiPath).setup();
}
const [major, minor] = absRequire(`typescript/package.json`).version.split(`.`, 2).map(value => parseInt(value, 10));
// In TypeScript@>=5.5 the tsserver uses the public TypeScript API so that needs to be patched as well.
// Ref https://github.com/microsoft/TypeScript/pull/55326
if (major > 5 || (major === 5 && minor >= 5)) {
moduleWrapper(absRequire(`typescript`));
}

// Defer to the real typescript/lib/tsserver.js your application uses
Expand Down
17 changes: 12 additions & 5 deletions .yarn/sdks/typescript/lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserverlibrary.js
require(absPnpApiPath).setup();
}
}

const moduleWrapper = tsserver => {
if (!process.versions.pnp) {
return tsserver;
Expand Down Expand Up @@ -214,11 +221,11 @@ const moduleWrapper = tsserver => {
return tsserver;
};

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserverlibrary.js
require(absPnpApiPath).setup();
}
const [major, minor] = absRequire(`typescript/package.json`).version.split(`.`, 2).map(value => parseInt(value, 10));
// In TypeScript@>=5.5 the tsserver uses the public TypeScript API so that needs to be patched as well.
// Ref https://github.com/microsoft/TypeScript/pull/55326
if (major > 5 || (major === 5 && minor >= 5)) {
moduleWrapper(absRequire(`typescript`));
}

// Defer to the real typescript/lib/tsserverlibrary.js your application uses
Expand Down
34 changes: 30 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,42 @@ RUN apt-get update && apt-get install -y rsync
ENV NODE_ENV=production

WORKDIR /usr/src/app
COPY . ./
COPY .yarn/releases .yarn/releases
COPY .yarnrc.yml yarn.lock package.json ./

# Copy only the elements needed for a Yarn install to take advantage of
# Docker's layer caching
# This is complex because we are working with multiple workspaces.

# Copy package JSON files with wildcards
# This scoops up all package.json files in the directory and subdirectories
# to deal with Yarn workspaces. However it requires BUILDKIT to be enabled,
# which is done by setting DOCKER_BUILDKIT=1 in the environment
RUN --mount=type=bind,target=/docker-context \
cd /docker-context/; \
find . -name "package.json" -mindepth 0 -maxdepth 5 -exec cp --parents "{}" /usr/src/app/ \;

RUN yarn install --immutable

# Load the cache from the previous build
RUN --mount=type=cache,target=/yarn-cache \
rsync -a /yarn-cache/ .yarn/cache \
rsync -a /yarn-cache/ .yarn/cache/ \
&& yarn install --immutable \
&& rsync -a .yarn/cache/ /yarn-cache

RUN yarn run bundle
# # Remove rsync
RUN apt-get remove -y rsync

# # Now we can run the full copy command

COPY . ./

ENV NODE_ENV=production

RUN yarn run build

EXPOSE 3000

CMD ["sh", "server/server.sh"]
ENV NODE_NO_WARNINGS=1

CMD ["yarn", "run", "server"]
7 changes: 0 additions & 7 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion deps/cesium-martini
2 changes: 1 addition & 1 deletion deps/cesium-viewer
2 changes: 1 addition & 1 deletion deps/web-components
Submodule web-components updated 230 files
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
"description": "Macrostrat map interface",
"type": "module",
"scripts": {
"bundle": "vite build",
"clean": "rm -rf dist/*",
"dev": "NODE_NO_WARNINGS=1 yarn run server:dev",
"build": "vite build",
"server": "node ./server/index.js",
"server:dev": "node --env-file=.env ./server/index.js",
"server": "tsx ./server/index.ts",
"server:dev": "tsx --env-file=.env ./server/index.ts",
"format": "prettier --write src packages",
"server:prod": "NODE_ENV=production yarn run server",
"server:prod": "NODE_NO_WARNINGS=1 NODE_ENV=production yarn run server",
"dev:storybook": "yarn workspace @macrostrat/storybook run dev",
"start": "yarn run build && yarn run server"
},
Expand Down Expand Up @@ -56,6 +55,7 @@
"@macrostrat-web/lithology-hierarchy": "workspace:*",
"@macrostrat-web/map-utils": "workspace:*",
"@macrostrat-web/qgis-integration": "workspace:*",
"@macrostrat-web/section-editor-demo": "workspace:*",
"@macrostrat-web/security": "workspace:*",
"@macrostrat-web/settings": "workspace:*",
"@macrostrat-web/sift": "workspace:*",
Expand All @@ -65,16 +65,19 @@
"@macrostrat/color-utils": "workspace:*",
"@macrostrat/column-components": "workspace:*",
"@macrostrat/column-views": "workspace:*",
"@macrostrat/corelle": "^2.0.1",
"@macrostrat/data-sheet2": "workspace:*",
"@macrostrat/feedback-components": "workspace:*",
"@macrostrat/hyper": "^2.2.1",
"@macrostrat/map-components": "workspace:*",
"@macrostrat/map-interface": "workspace:*",
"@macrostrat/mapbox-react": "workspace:^2.1.0",
"@macrostrat/mapbox-styles": "workspace:*",
"@macrostrat/mapbox-utils": "workspace:*",
"@macrostrat/style-system": "workspace:*",
"@macrostrat/timescale": "workspace:*",
"@macrostrat/ui-components": "workspace:*",
"@react-hook/size": "^2.1.2",
"@supabase/postgrest-js": "^1.11.0",
"@turf/bbox": "^6.5.0",
"@turf/boolean-contains": "^6.5.0",
Expand All @@ -87,6 +90,7 @@
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@types/react-redux": "^7.1.7",
"@universal-middleware/express": "^0.0.2",
"@visx/axis": "^2.14.0",
"@visx/scale": "^2.2.2",
"@vitejs/plugin-react": "^4.0.4",
Expand Down Expand Up @@ -119,21 +123,20 @@
"react-router": "^6.8.2",
"react-router-dom": "^6.8.2",
"react-router-hash-link": "^2.4.3",
"react-spring": "^9.7.3",
"reduce-reducers": "^1.0.4",
"redux": "^4.0.5",
"regl": "^1.5.0",
"resium": "^1.13.1",
"sirv": "^2.0.3",
"supports-color": "^9.4.0",
"swagger-ui-react": "^5.12.3",
"topojson-client": "^3.0.0",
"transition-hook": "^1.5.2",
"tsx": "^4.11.2",
"use-debounce": "^9.0.4",
"use-react-router-breadcrumbs": "^3.2.1",
"use-resize-observer": "^9.1.0",
"vike": "^0.4.159",
"vike-react": "^0.4.2",
"vite": "^5.0.12",
"vike": "^0.4.172",
"vike-react": "^0.4.11",
"vite": "^5.2.11",
"vite-plugin-cesium": "^1.2.22",
"zustand": "^4.5.1"
},
Expand Down
12 changes: 5 additions & 7 deletions packages/globe-dev/src/cesium-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import { ImageryLayer } from "resium";
import CesiumViewer, {
DisplayQuality,
MapboxLogo,
SatelliteLayer,
} from "@macrostrat/cesium-viewer";
import { MapboxImageryProvider } from "cesium";
import { elevationLayerURL } from "@macrostrat-web/settings";

// export function BaseLayer({ enabled = true, style, accessToken, ...rest }) {
// const provider = useRef(
Expand All @@ -33,13 +35,6 @@ function buildSatelliteLayer({ accessToken }) {
return provider;
}

const SatelliteLayer = (props) => {
const { accessToken, ...rest } = props;
let satellite = useRef(buildSatelliteLayer({ accessToken }));

return h(ImageryLayer, { imageryProvider: satellite.current, ...rest });
};

function CesiumView({ style, accessToken, ...rest }) {
const terrainProvider = useRef(
new TerrainProvider({
Expand All @@ -49,9 +44,12 @@ function CesiumView({ style, accessToken, ...rest }) {
highResolution: true,
skipZoomLevels: (z) => z % 3 != 0,
credit: "Mapbox",
urlTemplate: elevationLayerURL,
})
);

console.log("Access token", accessToken);

return h(
CesiumViewer,
{
Expand Down
3 changes: 0 additions & 3 deletions packages/globe-dev/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import * as Cesium from "cesium";
window.Cesium = Cesium;

import {
CameraParams,
DisplayQuality,
Expand Down
Loading

0 comments on commit e9ee49f

Please sign in to comment.