diff --git a/README.md b/README.md index 5fb4f32..d2e7a42 100644 --- a/README.md +++ b/README.md @@ -154,13 +154,8 @@ npm run dev:local Upload cards to S3 (change filenames as appropriate) ```sh jq -c . < cache/cards-core.json > ./cache/cards-core.min.json # minimise -nextstrain remote upload s3://nextstrain-staging/james/ cache/cards-core.min.json -rm ./cache/cards-core.min.json -``` - - jq -c . < cache/cards-blab.json > ./cache/cards-blab.min.json # minimise -nextstrain remote upload s3://nextstrain-staging/james/ cache/cards-blab.min.json - jq -c . < cache/cards-staging.json > ./cache/cards-staging.min.json # minimise -nextstrain remote upload s3://nextstrain-staging/james/ cache/cards-staging.min.json +nextstrain remote upload s3://nextstrain-staging/james/ cache/cards-*.min.json +rm ./cache/cards-*.min.json +``` diff --git a/src/intelligent-collapsing.ts b/src/intelligent-collapsing.ts index 5b65eab..9fd28dc 100644 --- a/src/intelligent-collapsing.ts +++ b/src/intelligent-collapsing.ts @@ -3,9 +3,24 @@ import YAML from 'yaml'; import { S3ContentEntry, S3VersionEntry, readReallyLargeYamlFile } from "./sources/s3.ts"; -const IO = {'objects': './cache/nextstrain-data.yaml', versions: './cache/nextstrain-data.versions.yaml', output: './cache/cards-core.json', ignoreKeys: (key:string) => key.includes('/')} -// const IO = {'objects': './cache/nextstrain-groups.yaml', versions: './cache/nextstrain-groups.versions.yaml', output: './cache/cards-blab.json', ignoreKeys: (key:string) => !key.startsWith('blab/datasets/')} -// const IO = {'objects': './cache/nextstrain-staging.yaml', versions: './cache/nextstrain-staging.versions.yaml', output: './cache/cards-staging.json', ignoreKeys: (key:string) => key.includes('/')} +const IO = { + objects: './cache/nextstrain-data.yaml', versions: './cache/nextstrain-data.versions.yaml', + output: './cache/cards-core.json', + ignoreKeys: (key:string) => key.includes('/'), + keyToName: (key:string) => key.replace(/\.json$/, '').split("_"), +} +// const IO = { +// objects: './cache/nextstrain-groups.yaml', versions: './cache/nextstrain-groups.versions.yaml', +// output: './cache/cards-blab.json', +// ignoreKeys: (key:string) => !key.startsWith('blab/datasets/'), +// keyToName: (key:string) => key.replace(/^blab\/datasets/, 'groups/blab').replace(/\.json$/, '').split("_"), +// } +// const IO = { +// objects: './cache/nextstrain-staging.yaml', versions: './cache/nextstrain-staging.versions.yaml', +// output: './cache/cards-staging.json', +// ignoreKeys: (key:string) => key.includes('/'), +// keyToName: (key:string) => key.replace(/^/, 'staging/').replace(/\.json$/, '').split("_"), +// } main(); @@ -30,7 +45,7 @@ async function main() { return; } - const fields: string[] = r.Key.replace(/\.json$/, '').split("_"); + const fields: string[] = IO.keyToName(r.Key); if (fields.filter((k) => k.match(/\d{4}-\d{2}-\d{2}/)).length) return; diff --git a/viz/src/cards-ui/card-component.tsx b/viz/src/cards-ui/card-component.tsx index beb2b3e..b0b9553 100644 --- a/viz/src/cards-ui/card-component.tsx +++ b/viz/src/cards-ui/card-component.tsx @@ -219,7 +219,7 @@ function Name({name, isDataset}:{name:string, isDataset:boolean}) { } function Logo(name:string) { - if (name.startsWith('blab/')) return + if (name.startsWith('groups/blab/')) return return }