Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/faker-js/faker-9.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mreed101 authored Oct 10, 2024
2 parents ccd190e + 68b409b commit 55965ad
Show file tree
Hide file tree
Showing 23 changed files with 257 additions and 175 deletions.
47 changes: 46 additions & 1 deletion .github/workflows/content-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,52 @@ jobs:
fi
- name: Build sitemap
run: cd main && yarn build:sitemap
run: |
cd main && yarn build:sitemap
cd out
if [ -f sitemap.xml ]; then
echo "File found!"
cp sitemap.xml sitemap-nb.xml
else
touch sitemap-nb.xml
fi
shell: bash

- name: setup bucket descriptor
id: bucket-descriptor
run: |
if [ "${{ inputs.build_type }}" == 'dev' ]; then
echo NEXT_SITEMAP_LOCATION="https://dev.va.gov/sitemap-nb.xml" >> $GITHUB_OUTPUT
echo OLD_SITEMAP_LOCATION="https://dev.va.gov/sitemap-cb.xml" >> $GITHUB_OUTPUT
elif [ "${{ inputs.build_type }}" == 'staging'] ; then
echo NEXT_SITEMAP_LOCATION="https://staging.va.gov/sitemap-nb.xml" >> $GITHUB_OUTPUT
echo OLD_SITEMAP_LOCATION="https://staging.va.gov/sitemap-cb.xml" >> $GITHUB_OUTPUT
elif [ "${{ inputs.build_type }}" == 'prod' ]; then
echo NEXT_SITEMAP_LOCATION="https://www.va.gov/sitemap-nb.xml" >> $GITHUB_OUTPUT
echo OLD_SITEMAP_LOCATION="https://www.va.gov/sitemap-cb.xml" >> $GITHUB_OUTPUT
else
echo NEXT_SITEMAP_LOCATION="https://www.va.gov/sitemap-nb.xml" >> $GITHUB_OUTPUT
echo OLD_SITEMAP_LOCATION="https://www.va.gov/sitemap-cb.xml" >> $GITHUB_OUTPUT
fi
shell: bash

- name: Generate new sitemap
run: |
cd main
cd out
echo "${{steps.bucket-descriptor.outputs.OLD_SITEMAP_LOCATION}}"
cat <<'EOF' >> sitemap.xml
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>${{steps.bucket-descriptor.outputs.NEXT_SITEMAP_LOCATION}}</loc>
</sitemap>
<sitemap>
<loc>${{steps.bucket-descriptor.outputs.OLD_SITEMAP_LOCATION}}</loc>
</sitemap>
</sitemapindex>
EOF
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions READMEs/business-logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ For event articles, it was decided to keep time localization on Next rather than

## Implementation

The timezone calculations can be found in the [date.ts](src/lib/utils/date.ts) file line 219 `deriveFormattedTimestamp`.
The timezone calculations can be found in the [date.ts](../src/lib/utils/date.ts) file line 219 `deriveFormattedTimestamp`.

## Contact/Owner

Expand Down Expand Up @@ -85,7 +85,7 @@ Next has a condition that detects whether an event has passed. If the event has

## Implementation

The business logic can be found in the [event index.ts](src/templates/layouts/event/index.tsx) file line 224.
The business logic can be found in the [event index.ts](../src/templates/layouts/event/index.tsx) file line 224.

## Contact/Owner

Expand Down
21 changes: 10 additions & 11 deletions READMEs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ The goal of this document is to be used as a reference sheet to quickstart devel

## Recommended READMEs to start with

- [generators.md](READMEs/generators.md) : Read to understand how to quickly generate layout, component, and query templates
- [queries.md](READMEs/quickstart.md) : Read to understand the database queries or search parameters that are being used in your project, as this file typically contains information or documentation related to database interactions.
- [templates.md](READMEs/templates.md) : Read to understand the structure and organization of front-end templates in the src/templates directory, including their categorization, required files, and usage of React components and types.
- [typescript.md](READMEs/typescript.md) : Read to understand how Typescript is used in the next-build application, including the structure and usage of specific types, the flow of data through the application, and how to configure Typescript for development. It also provides insights into the application's architecture and the rationale behind certain design decisions.
- [testing.md](READMEs/testing.md) : Read to understand the testing procedures.
- [[...slug.md]]() : Read to understand how next-build handles page routing and the history and thought process to its decision.
- [preview.md](READMEs/preview.md) : Recommended README for preview issue during setup
- [generators.md](generators.md) : Read to understand how to quickly generate layout, component, and query templates
- [queries.md](queries.md) : Read to understand the database queries or search parameters that are being used in your project, as this file typically contains information or documentation related to database interactions.
- [templates.md](templates.md) : Read to understand the structure and organization of front-end templates in the src/templates directory, including their categorization, required files, and usage of React components and types.
- [typescript.md](typescript.md) : Read to understand how Typescript is used in the next-build application, including the structure and usage of specific types, the flow of data through the application, and how to configure Typescript for development. It also provides insights into the application's architecture and the rationale behind certain design decisions.
- [testing.md](testing.md) : Read to understand the testing procedures.
- [[...slug.md]]([[...slug]].md) : Read to understand how next-build handles page routing and the history and thought process to its decision.
- [preview.md](preview.md) : Recommended README for preview issue during setup

The rest of the READMEs still hold valuable information, but might be running in the background, used for specific situations, or holds information that will make the development process easier, but is not mandatory to get things up and running

Expand Down Expand Up @@ -52,9 +52,8 @@ This is a high-level breakdown of what will the core areas in the repository you
## Generating a layout
As listed above, please read [generators.md](READMEs/generators.md)
As listed above, please read [generators.md](generators.md)
[Link to environment setup documentation](https://github.com/department-of-veterans-affairs/next-build/tree/main?tab=readme-ov-file#next-build)
A video walkthrough should be available to assist in setting up. If not compressed and posted here yet. The Slack thread in which they exist is [here](https://dsva.slack.com/archives/D071CCW690E/p1723650927105169). The 30 minute video is the layout creation walkthrough.
> [!NOTE]
Expand Down Expand Up @@ -90,7 +89,7 @@ When creating a new layout, create a new feature branch from main and use `yarn
- Path `src/data/queries/tests/snapshots/<layout name.test.tsx.snap>`
- Automatically generated jest snapshot
- Compares current output of `formatData` to the snapshot
- Snapshot may not update immediately and would require to run a manual `yarn test -- -u`. Details from [testing.md](READMEs/testing.md)
- Snapshot may not update immediately and would require to run a manual `yarn test -- -u`. Details from [testing.md](testing.md)
- Path `src/mocks/<layout name.mock.json>`
- Copy and paste one JSON object from Drupal API to be used in Jest tests
- Path `playwright/tests/<layout name.spec.js>`
Expand Down Expand Up @@ -179,7 +178,7 @@ You won’t be able to commit unless:
- Yarn test will run tests on the entirety of next-build
- Once you commit and push for pull request, a series of tests will run on the pull request
- One of the common points of failed passing is tugboat which will have an error log to view why tugboat failed
- Our [tugboat ReadME](READMEs/tugboat.md) is brief but should redirect to the VA tugboat doc for more information.
- Our [tugboat ReadME](tugboat.md) is brief but should redirect to the VA tugboat doc for more information.
## Test commands
Expand Down
2 changes: 1 addition & 1 deletion docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
ls -al envs

APP_ENV=$APP_ENV yarn build:preview && yarn start
5 changes: 4 additions & 1 deletion envs/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=N9BisSDKAwJENFQtQIEvXQ
NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-423

# Feature flags for enabling content types. These should only be added when you are preparing to go to prod and are testing on dev.
FEATURE_NEXT_BUILD_CONTENT_EVENT=true
# It is better to test these from the CMS backend for dev than here.
FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true
FEATURE_NEXT_BUILD_CONTENT_EVENT=true


4 changes: 0 additions & 4 deletions envs/.env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-1
# For example, never add and enable a variable like the following to this file:
# FEATURE_NEXT_BUILD_CONTENT_EVENT=true
# Again, do NOT add these here.

# ... Except, prior to initial launch, we will need these here for prod testing.
FEATURE_NEXT_BUILD_CONTENT_EVENT=true
FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true
3 changes: 1 addition & 2 deletions envs/.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=inC4EKQce9vlWpRVcowiyQ
NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-661

# Feature flags for enabling content types. These should only be added when you are preparing to go to prod and are testing on staging.
FEATURE_NEXT_BUILD_CONTENT_EVENT=true
FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true
# It is better to test these from the CMS backend for staging than here.
5 changes: 3 additions & 2 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ const sitemapConfig = {
siteUrl: process.env.SITE_URL || 'https://localhost:8001',
// output: 'export' directory from next config
outDir: 'out',
generateIndexSitemap: true,
generateIndexSitemap: false,
sitemapSize: 100000, //set some large size in bytes so we have one sitemap.xml?
// relative paths to exclude
exclude: [],

generateRobotsTxt: true, // (optional)
generateRobotsTxt: false, // (optional)

// todo: migrate to server side sitemap to include last edited date from content for lastmod
// will need to update static-path-resources to optionally include that field when requested
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.7",
"@types/lodash": "^4.17.10",
"@types/node": "22.5.4",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.2.18",
Expand Down
8 changes: 2 additions & 6 deletions packages/env-loader/src/env-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@ import { EnvVars } from '.'

const loadEnvVarsFromPath = (path: string): EnvVars => {
const envVars = {}
// eslint-disable-next-line no-console
console.log(`trying to load vars from ${path}`)
dotenvExpand.expand(
dotenv.config({
path: path,
path,
override: true,
processEnv: envVars,
debug: true,
})
)

// eslint-disable-next-line no-console
console.log(`Using environment variables from: ${path}`)
// eslint-disable-next-line no-console
console.log(envVars)

return envVars
}

Expand Down
22 changes: 22 additions & 0 deletions src/assets/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,25 @@ body {
height: 44px;
width: 133px;
}

/* header search styles */
.header-search {
input {
max-width: unset;
}
}

.search-input-container {
max-width: unset !important;
}

.search-input {
max-width: unset !important;
}

.search-button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
height: 42px;
width: 45px;
}
2 changes: 1 addition & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type AppPropsWithLayout = AppProps & {

export function reportWebVitals(metric: object) {
// eslint-disable-next-line no-console
console.log(metric)
// console.log(metric)
}

export default function MyApp({
Expand Down
Loading

0 comments on commit 55965ad

Please sign in to comment.