10.0.0 • Published 10 months ago

@financial-times/rel-engage v10.0.0

Weekly downloads
209
License
ISC
Repository
github
Last release
10 months ago

@financial-times/rel-engage

Standardised tools for JavaScript projects owned by the Engineering Insights team. It includes common configuration for linting and formatting of source files and solve other common tasks.

Installation

This is package for Node.js and is available through the npm registry. Using Node 20 or higher is recommended.

Installation is done using the npm install command:

npm install -S @financial-times/rel-engage

Next copy the Makefile template into your project. This imports a number of pre-configured Make recipes for your project:

cp node_modules/@financial-times/rel-engage/templates/project-makefile.mk Makefile

Finally, execute the install recipe which will generate a number of configuration files:

make install

Commands

By default the rel-engage Makefile provides a number of commands for common tasks, including:

  • install to install Node modules and create configuration files.
  • verify to run linting and code formatting tools.
  • clean to undo all changes and remove files that are not tracked by version control.
  • env to fetch and save project secrets

To view a list of all commands and their descriptions, run:

make help

Configuration

Each time you run the make install command provided by this package a number of configuration files will be added to your project if not already present:

  • EditorConfig (.editorconfig) - provides whitespace settings for your editor when creating new files.
  • ESLint (.eslintrc.js, .eslintignore) - configuration for linting JavaScript.
  • Husky (.huskyrc.js) - installs and configures Git hooks to run commands before committing and pushing code.
  • lint-staged (.lintstagedrc.cjs) - configures commands to run only on changed files that will be committed.
  • Prettier (.prettierrc.js, .prettierignore) - automatic formatting for JavaScript, JSON, YAML, and more.

The created "dotfiles" link to shared configuration provided by this package and do not contain any rules themselves.

These rules should rarely need to be overridden but if you do need to then it's possible to directly modify them, either by using the built in support for the tool (e.g ESLint supports an extends pattern), or by manually extending the provided JavaScript objects themselves.

Secrets

Project secrets (such as API keys) are stored in Doppler and can be used by executing commands via use of the doppler run --command="...".

Secrets in Doppler are stored in projects; one for each system and one for each team's shared secrets.

Secrets for local development

To get started, ensure that you have the doppler-cli installed and configured correctly and that you are in the GLO-OKTA-DOPPLER-ENGINEERING-INSIGHTS okta group.

Once this is done you should be able to run the doppler login command. If you run into any problems then you can ask for help on the #reliability-eng Slack channel.

Note the doppler login only authenticates you with Doppler; it does not allow you to access any secrets. To access the secrets in your current project you must define a PROJECT_NAME in your makefile. For example:

    PROJECT_NAME=biz-ops-route53-importer

Once a PROJECT_NAME as been defined then you can inject the test secrets into your local session by running:

    make env

If you need to access prod secrets then use the following:

    make env ENV=prod

Secrets on CircleCI

When Doppler credentials are required as part of your CI pipeline these can be retrieved by appending the load_secrets command from the ft-circleci-orbs\/doppler-circleci orb to your workflow jobs:

  test:
    <<: *default_container_config
    steps:
      - *attach_workspace
      - load_secrets:
          config: TEST
      - run:
          name: Run unit tests
          command: make unit-test

Contributing

Requirements

To get started with this project you'll need to make sure you have the following software tools installed.

  1. Git
  2. Node.js (version 20 or higher is required)
  3. npm

Please note that Page Kit has only been tested in Mac and Linux environments. If you are on a Mac you may find it easiest to install the Command Line Tools package which includes Git.

Project installation

  1. Clone the project's Git repository and change to the new directory that has been created:

    git clone git@github.com:Financial-Times/rel-engage
    cd rel-engage
  2. Install all of the project dependencies (this may take a few minutes if you are running this for the first time):

    make install
10.0.0

10 months ago

10.0.0-beta.2

10 months ago

10.0.0-beta.3

10 months ago

10.0.0-beta.1

10 months ago

10.0.0-beta.4

10 months ago

10.0.0-beta.5

10 months ago

9.3.0

11 months ago

9.2.0

12 months ago

8.0.9

2 years ago

9.1.0

2 years ago

8.0.10

2 years ago

9.0.0

2 years ago

8.0.8

3 years ago

9.0.0-beta.3

4 years ago

9.0.0-beta.2

4 years ago

9.0.0-beta.1

4 years ago

8.0.7

4 years ago

8.0.6

4 years ago

8.0.5

4 years ago

8.0.4

4 years ago

8.0.3

4 years ago

8.0.2

5 years ago

8.0.1

5 years ago

8.0.0

5 years ago

8.0.0-beta.3

5 years ago

8.0.0-beta.2

5 years ago

8.0.0-beta.1

5 years ago

7.4.3

5 years ago

7.4.2

5 years ago

7.4.1

5 years ago

7.4.0

5 years ago

7.3.3

5 years ago

7.3.2

5 years ago

7.3.2-beta.1

5 years ago

7.3.1

6 years ago

7.3.0

6 years ago

7.3.0-beta.1

6 years ago

7.3.0-beta.2

6 years ago

7.2.2

6 years ago

7.2.1

6 years ago

7.2.0

6 years ago

7.1.4

6 years ago

7.1.3

6 years ago

7.1.2

6 years ago

7.1.1

6 years ago

7.1.0

6 years ago

7.0.2

6 years ago

7.0.1

6 years ago

7.0.0

6 years ago

6.0.1

6 years ago

6.0.0

6 years ago

5.0.3

6 years ago

5.0.2

6 years ago

5.0.1

6 years ago

5.0.0

6 years ago

5.1.0-beta.13

6 years ago

5.1.0-beta.12

6 years ago

5.1.0-beta.10

6 years ago

5.1.0-beta.9

6 years ago

5.1.0-beta.7

6 years ago

5.1.0-beta.6

7 years ago

5.1.0-beta.5

7 years ago

5.1.0-beta.3

7 years ago

5.1.0-beta.2

7 years ago

5.1.0-beta.1

7 years ago

0.0.0

7 years ago

4.1.2

7 years ago

4.1.1

7 years ago

4.1.0

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.1.1

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.1.3

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.2

7 years ago