This package contains components, utils, providers and hooks developed and used by the amplify team.
Build and publish is done automatically when code is merged into main
branch, if the package.json version number is higher.
-
Navigate to your projects root folder,
~/Projects/recap
for instance -
Copy and run the following command
wget -q -O - https://raw.githubusercontent.com/equinor/amplify-component-lib/main/config/install.sh | bash
This should have downloaded the different config files to your project root folder.
If you want to ignore certain configuration files you can create a .acl-ignore
file in the client
folder in your project.
For example: acquire/client/.acl-ignore
eslint.config.mjs
CODEOWNERS
pull_request.yaml
-
Navigate to your projects root folder,
~/Projects/recap
for instance -
Copy and run the following command
wget -q -O - https://raw.githubusercontent.com/equinor/amplify-component-lib/main/config/install-deployment-files.sh | bash
This should have downloaded the build_deploy_radix.yaml
, promote.yaml
, notify.yaml
, push.yaml
NOTE: These files should eventually be served from the same install script we use for getting other config files. We serve it from a different script so that applications which are not ready for the change in deployment process don't have to rush.
This script assumes the following structure in the project
project
│ README.md
│
└───client
│ | ...
│
└───server
│ ...
Using pre-commit
Using python's pip to download pre-commit
pip install pre-commit
Using brew to download pre-commit
brew install pre-commit
finally install pre-commit
pre-commit
Your .pre-commit-config.yaml
file should look something like below
repos:
- repo: local
hooks:
- id: hadolint
name: Lint Dockerfiles
description: Runs hadolint to lint Dockerfiles
language: system
types: ['dockerfile']
entry: hadolint
- id: trufflehog
name: TruffleHog
description: Detect secrets in your data with TruffleHog.
entry: trufflehog git file://. --since-commit HEAD --only-verified --fail
language: golang
pass_filenames: false
- id: prettier
name: Prettier
description: Runs prettier on supported files
language: system
entry: 'npx prettier --check'
files: .*\.jsx?$|.*\.tsx?$|.*\.ts?$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.9.0
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [file]
additional_dependencies:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
When you have your config file in place you need to install the hooks
pre-commit install
We use hadolint to check that our docker file is using best practice.
In order to commit changes related to a dockerfile you need to have hadolint installed
On OSX you can use brew to install:
brew install hadolint
On Windows you can use scoop to install:
scoop install hadolint
In any of these do not work then you can refer to the installation section in hadolint's repository
If you want to shorten the feedback loop when changing your dockerfile you can optionally add the hadolint extension (Extension id: exiasr.hadolint
)
Looks like it is not available for WebStorm at the moment