GithubHelp home page GithubHelp logo

joecowton1 / not-csnx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guardian/csnx

0.0 0.0 0.0 5.48 MB

Test

Home Page: https://guardian.github.io/csnx

License: Apache License 2.0

Shell 0.23% JavaScript 2.80% TypeScript 91.21% Makefile 0.28% HTML 5.48%

not-csnx's Introduction

csnx

Monorepo for Guardian UIs

Snyk Vulnerabilities for GitHub Repo Libraries.io dependency status for GitHub repo

Projects in the monorepo

Packages

The following packages live in libs/@guardian/* and are published to NPM:

Development

  1. Clone the repo
  2. Run a task.

You'll be prompted to install any missing requirements if they are needed...

Running tasks

Tasks are defined in the Makefile.

  • make atoms-rendering-nginx-setup runs nginx setup script in atoms-rendering
  • make build-storybooks builds all storybooks
  • make build builds all projects
  • make changeset creates a new changeset
  • make clean removes all build artifacts
  • make e2e runs the e2e tests for all projects
  • make fix attemps to fix lint errors across all projects
  • make lint checks all projects for lint errors
  • make storybooks runs storybook for all projects in single instance
  • make test runs the unit tests for all projects
  • make validate makes sure absolutely everything is working

Task caching

The repo is managed by Nx.

Nx remotely caches the output of build, lint, test, e2e, and build-storybook.

This means only one full iteration of these tasks runs for a given state of a project โ€“ ever โ€“ which makes them extremely fast to re-run.

For example, you're working on something, run the tests and they pass. Nx remotely caches the result. You push your changes to CI. When CI runs the tests, nothing has changed, so Nx fetches the (passing) cached results, the build goes green and you can merge.

When I pull your changes, my copy of the code is identical to what you pushed and merged, so I also get the cached results. If I then change the code, Nx re-runs the tests and, again, caches the results.

This happens per project. So if you change project-a but not project-b, Nx will get the cached results for project-b, but still run the tests for project-a. From then on, until project-a changes again, Nx will always use the cached results for both.

This includes between development and CI, between machines, pulls etc.

Skipping the cache

To force the tasks in the Makefile to skip the Nx cache, set SKIP_NX_CACHE=true, e.g.

SKIP_NX_CACHE=true make test

Troubleshooting

Unable to commit

If you get a command not found error or a message saying you're using the wrong version of Node when commiting using a GUI (VSCode, GitHub desktop etc), add a ~/.huskyrc file and load your Node version manager there.

For example, if you use fnm:

# ~/.huskyrc
eval "$(fnm env)"
fnm use

Or for asdf:

# ~/.huskyrc (installed with git)
. $HOME/.asdf/asdf.sh
# ~/.huskyrc (installed with brew on intel macs)
. /usr/local/opt/asdf/libexec/asdf.sh
# ~/.huskyrc (installed with brew on apple silicon)
. /opt/homebrew/opt/asdf/asdf.sh

Or for nvm:

# ~/.huskyrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && nvm use

See https://typicode.github.io/husky/#/?id=command-not-found for more info.

not-csnx's People

Contributors

sndrs avatar github-actions[bot] avatar ob6160 avatar joecowton1 avatar renovate[bot] avatar sophie-macmillan avatar tjsilver avatar mxdvl avatar arelra avatar siadcock avatar marjisound avatar georges-gnm avatar oliverlloyd avatar bryophyta avatar abeddow91 avatar jirihofman avatar vlbee avatar danielcliftonguardian avatar akash1810 avatar ashishpuliyel avatar tjmw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.