Skip to content

Commit

Permalink
link-all.sh (aws#20)
Browse files Browse the repository at this point in the history
Allows symlinking the CDK repo into node_modules.

TODO: symlink binaries

* update README
  • Loading branch information
eladb authored Jun 5, 2018
1 parent 62bdc34 commit d1f87bd
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,31 @@ cd packages/aws-cdk-s3
lr watch
```

## Linking against this repository

The script `./link-all.sh` can be used to generate symlinks to all modules in
this repository under some `node_module` directory. This can be used to develop
against this repo as a local dependency.

One can use the `postinstall` script to symlink this repo:

```json
{
"scripts": {
"postinstall": "../aws-cdk/link-all.sh"
}
}
```

This assumes this repo is a sibling of the target repo and will install the CDK
as a linked dependency during __npm install__.

## Commits and Pull Requests

Commits should follow the
[conventional-changelog-standard](https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md)
to allow automatic changelog generation.

## Package Linter

The `pkglint` tool normalizes all packages in the repo. It verifies package.json
Expand Down
11 changes: 11 additions & 0 deletions link-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# creates symlinks under node_modules for all packages in this repo
# can be used to work against this code base.
set -euo pipefail
root="$(cd $(dirname $0) && pwd)"

modules="$(find ${root}/packages -name package.json | grep -v node_modules | grep -v init-templates | xargs -n1 dirname)"
for module in ${modules}; do
echo "${module} => node_modules/$(basename ${module})"
ln -s ${module} node_modules/
done

0 comments on commit d1f87bd

Please sign in to comment.