From 60b1811d2051b335ee9d0107c64fbb7dae9f8a08 Mon Sep 17 00:00:00 2001 From: atarashansky Date: Thu, 9 May 2024 23:27:05 -0700 Subject: [PATCH] chore: add filter descendants to gitignore and remove from git tree (#7013) Co-authored-by: Timmy Huang --- frontend/.gitignore | 20 +++++-------------- frontend/Dockerfile | 11 ++++++++++ frontend/package-lock.json | 1 + frontend/package.json | 3 +-- .../cell_type_descendants.json | 1 - .../tissue_descendants.json | 1 - frontend/src/global.d.ts | 10 ++++++++++ 7 files changed, 28 insertions(+), 19 deletions(-) delete mode 100644 frontend/src/components/common/Filter/descendant_mappings/cell_type_descendants.json delete mode 100644 frontend/src/components/common/Filter/descendant_mappings/tissue_descendants.json diff --git a/frontend/.gitignore b/frontend/.gitignore index 5fedafacaafbc..0044c90ec0e84 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -87,18 +87,8 @@ loginState.json public/sitemap* public/robots.txt -# Cell Guide -src/views/CellGuide/common/fixtures/allCellTypeDescriptions.json -src/views/CellGuide/common/fixtures/allCellTypeDescriptionsSEO.json -src/views/CellGuide/common/fixtures/allCellTypeMarkerGenes.json -src/views/CellGuide/common/fixtures/allCellTypeOwlDescriptions.json -src/views/CellGuide/common/fixtures/allCellTypes.json -src/views/CellGuide/common/fixtures/allEnrichedGenes/ -src/views/CellGuide/common/fixtures/allSourceData.json -src/views/CellGuide/common/fixtures/allTissueDescriptions.json -src/views/CellGuide/common/fixtures/allTissues.json -src/views/CellGuide/common/fixtures/ontologyTree.json -src/views/CellGuide/common/fixtures/ontologyTreeStatePerCellType.json -src/views/CellGuide/common/fixtures/ontologyTreeStatePerTissue.json - -certificates \ No newline at end of file +# Filter descendants +src/components/common/Filter/descendant_mappings/cell_type_descendants.json +src/components/common/Filter/descendant_mappings/tissue_descendants.json + +certificates diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 435816aa81b2e..5890f5ab2949e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -18,14 +18,25 @@ RUN apt-get update && apt-get install -y make wget \ lsb-release xdg-utils nano vim procps moreutils ripgrep \ && rm -rf /var/lib/apt/lists/* +# Create the directory `make retrieve-descendants` expects before running npm ci, which runs `make retrieve-descendants` +# as a preinstall script +RUN mkdir -p src/components/common/Filter/descendant_mappings + +COPY Makefile ./ COPY package*.json ./ RUN npm ci --verbose --no-optional && npm cache clean --force + ENV PATH /opt/node_app/node_modules/.bin:$PATH # -- TODO, we should try turning this back on later. # ADD --chown=node . /corpora-frontend ADD . /corpora-frontend + +# Explicitly copy the JSON files from the earlier steps +RUN cp -r /opt/node_app/src/components/common/Filter/descendant_mappings/* /corpora-frontend/src/components/common/Filter/descendant_mappings/ + WORKDIR /corpora-frontend + ADD ./src/configs/build.js src/configs/configs.js RUN mkdir -p node_modules RUN ln -sf /opt/node_app/node_modules/* /opt/node_app/node_modules/.bin ./node_modules/. diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 88f6ae35895ec..d709719a8979c 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "cellxgene-data-portal", "version": "0.1.0", + "hasInstallScript": true, "license": "MIT", "dependencies": { "@blueprintjs/core": "^5.8.2", diff --git a/frontend/package.json b/frontend/package.json index 9129a02f72cf8..8eb40cf3c7c9c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -118,8 +118,7 @@ ], "license": "MIT", "scripts": { - "predev": "make retrieve-descendants", - "prebuild": "make retrieve-descendants", + "preinstall": "make retrieve-descendants", "dev": "next dev --experimental-https", "build": "NODE_OPTIONS=\"--max_old_space_size=2048\" next build", "start": "next start", diff --git a/frontend/src/components/common/Filter/descendant_mappings/cell_type_descendants.json b/frontend/src/components/common/Filter/descendant_mappings/cell_type_descendants.json deleted file mode 100644 index 9e26dfeeb6e64..0000000000000 --- a/frontend/src/components/common/Filter/descendant_mappings/cell_type_descendants.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/frontend/src/components/common/Filter/descendant_mappings/tissue_descendants.json b/frontend/src/components/common/Filter/descendant_mappings/tissue_descendants.json deleted file mode 100644 index 9e26dfeeb6e64..0000000000000 --- a/frontend/src/components/common/Filter/descendant_mappings/tissue_descendants.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/frontend/src/global.d.ts b/frontend/src/global.d.ts index 4b0f4cfcec335..baa8fa2292779 100644 --- a/frontend/src/global.d.ts +++ b/frontend/src/global.d.ts @@ -20,3 +20,13 @@ namespace HubSpotFormAPI { } declare const hbspt: HubSpotFormAPI.HubSpot; + +declare module "src/components/common/Filter/descendant_mappings/cell_type_descendants.json" { + const value: { [key: string]: string[] }; + export default value; +} + +declare module "src/components/common/Filter/descendant_mappings/tissue_descendants.json" { + const value: { [key: string]: string[] }; + export default value; +}