Skip to content

equinor/energyvision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

839926a · Mar 24, 2025
Dec 20, 2023
Mar 20, 2025
Jun 8, 2023
Nov 22, 2024
Nov 4, 2024
Aug 3, 2023
Apr 7, 2023
Mar 19, 2025
Dec 19, 2024
Mar 24, 2025
Apr 10, 2024
Mar 8, 2021
Sep 11, 2024
Aug 21, 2024
Apr 10, 2024
Sep 21, 2021
Apr 10, 2024
Jun 2, 2022
Aug 16, 2024
Oct 29, 2021
Feb 3, 2023
Jul 28, 2022
Mar 10, 2021
Mar 20, 2025
Mar 3, 2021
Mar 17, 2025
Nov 20, 2024
Jun 8, 2023
Dec 21, 2021
Jan 21, 2025
Nov 4, 2024
Dec 20, 2023
Mar 20, 2025
Mar 20, 2025
Nov 12, 2021

Repository files navigation

EnergyVision

This is the main repository for the equinor.com website. This version of the website is built using the Sanity content platform as headless CMS and Next.js for the web frontend.

The project is licensed under the MIT license following the open source strategy of Equinor and integrates elements from the Equinor Design System.

Getting started

This project uses pnpm as main package manager. You can install pnpm using npm as shown below, or use one of the alternative installation methods.

# Install pnpm
npm i -g pnpm

# Install all project dependencies
pnpm setup-project

For compatibility reasons, the Sanity Studio uses the Yarn package manager, and the search indexer uses npm. The pnpm setup-project script will automatically install the dependencies for the Studio as well as the workspace packages listed in pnpm-workspace.yaml. See the section on package managers for more information.

This project requires several environment variables to run. These environment variables should be added in sanityv3/.env.development, web/.env.local, and search/.env respectively.

Project overview

This monorepo is organized into several folder. Please refer to README files inside each folder for more information.

  • sanityv3 - Sanity powered content platform.
  • web - Web application using Next.js and React components.
  • search - Azure functions for maintaining search indexes at Algolia.
  • legacy - Archived code/content from previous versions of the equinor.com website.

Package managers

This project uses the pnpm package manager. All commands should be run from root. There are filter aliases in the root package.json file that can be used to run commands in specific directories. For example:

# Install dependencies
pnpm web install

# Start the web in dev mode
pnpm web dev

# Add some package to the web folder
pnpm web add <some-package>

# Build Next.js
pnpm web build

If you need to add arguments to scripts when using one of the aliases, such as --force or --dev to force a re-install of all dependencies, you must add -- when running these commands from the project root. For example:

# Add a dev-dependency
pnpm web add chalk -- --save-dev

Studio

# Start studio in dev mode
pnpm sanityv3 dev

Search

Due to compatibility issues, npm is used for the Search Indexers. The reason being that it was not possible (with pnpm v6 at least) to generate a package containing all dependencies from the search folder. So in order to work with dependencies for anything under search, use npm from within that folder. You can still use pnpm from the root folder to execute scripts however.

Legacy packages

The legacy folder contains packages related to static content from the AEM based equinor.com website and the legacy CSS/JavaScript needed to run this static content. These packages are rarely updated and rely on outdated and/or deprecated dependencies. This causes issues when using a node version higher than node v14 on certain platforms (for example node-sass does not compile). When working on these packages, be sure to switch to node v14 to build the packages.

The legacy packages are currently excluded from the pnpm workspace (see pnpm-workspace.yaml) so will not have their dependencies installed when running pnpm setup-project / pnpm m i / pnpm recursive install from the project root.

Feature flags

These feature flags are based on the currently active Sanity dataset. This allows us to have features that are based on dataset. For example some features related to analytics can be disabled in development dataset where it is not needed. Not all features in global dataset are used in other datasets.

Contributing

If you want to report a bug, please create an issue in GitHub unless it is a security issue. If it is a security issue, please follow our Security Reporting Policy in SECURITY.md file.

About

Home of the equinor.com website

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 19