Security
See CONTRIBUTING for more information.
License
This project is licensed under the Apache-2.0 License.
Set up your local development environment
# clone project repo
cd <project directory>
npm run install:local
npm run test
npm run install:local
will run npm install
, then build all packages in the project and run npm link
npm run test
will run all the unit tests in the project
You should now be able to run the new amplify
CLI.
Other helpful scripts
npm run watch
will start the tsc server and watch for changes in all packages
npm run test:coverage:threshold
will let you know if your changes are passing test coverage limits
npm run test:dir packages/<package directory>
will run only the tests in that directory
npm run vend
will start a local npm proxy and publish the local packages to this proxy so they can be installed / used as if they were published on npm
npm run e2e
will run the E2E test suite. Note: you must have valid AWS credentials configured locally to run this command successfully.
Creating changesets
This repo uses changesets for versioning and releasing changes.
All changes that affect release artifacts must have a corresponding changeset. To create a changeset run changeset
.
This will start a walkthrough to author the changeset file. This file should be committed to the repo.
Publishing packages locally
Publishing packages locally allows you to install local package changes as if they were published to NPM. This is useful for testing or demo scenarios.
To set up a local npm proxy and publish the current local state to the proxy, run npm run vend
.
This will start a local npm proxy using Verdaccio and run changeset version
and changeset publish
.
This will also point your local npm config to the local npm proxy. At this point you can npm install any packages in the repo and it will pull from the local proxy instead of directly from npm.
To stop the local server and reset your npm registry run npm run stop:npm-proxy
.
To clear the proxy package cache run npm run clean:npm-proxy
. This will stop the local proxy and remove all packages you have published.
To start the npm proxy without immediately publishing, run npm run start:npm-proxy
.
To publish a snapshot to an already running npm proxy run npm run publish:snapshot:local latest
Adding a package
This repo uses a monorepo structure managed by npm workspaces. All the packages in the workspace are under packages/*
There are package templates for some common scenarios in the templates
directory.
These templates can be copied to a new package directory using npm run new -- --template=<template> --name=<new name>
--template
specifies which template to use and --name
specifies the new package name.
Valid templates are the directories in the templates
directory
If you are adding a new package that does not have a template, consider adding a template for that package type. You'll probably want to use an existing template as a starting point for the new package.
At a minimum, each package needs:
- A
package.json
file - A
tsconfig.json
file. This file should extendtsconfig.base.json
- An
api-extractor.json
file. This file should extendapi-extractor.base.json
- An
update:api
script in thepackage.json
file - A
typedoc.json
file - An
.npmignore
file