Skip to content

Commit c41df9c

Browse files
authored
chore: clean up repository root, shrinkwrap CLIs (#696)
Move all files that don't need to be at the repository root under the dedicated sub-directory for those. This means all `.sh` files were moved under `scripts`. Some of those were also renamed, and the common uses have been aliased using `package.json` scripts (`npm run bootstrap`, `npm run build`, `npm run package`, ...). Additionally, ran `npm shrinkwrap` on the major CLIs (`jsii`, `jsii-diff`, `jsii-pacmak`) as a way to improve overall reliability.
1 parent b0b3fd2 commit c41df9c

File tree

16 files changed

+63
-42
lines changed

16 files changed

+63
-42
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules/
2-
.BUILD_COMPLETED
32
lerna-debug.log
43
tsconfig.tsbuildinfo
54
.DS_Store

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ script:
1313
# Building the Docker image
1414
- docker build --pull --build-arg BUILD_TIMESTAMP=$(date -u +'%Y-%m-%dT%H:%M:%SZ') --build-arg COMMIT_ID="${TRAVIS_COMMIT}" -t "jsii/superchain:nightly" ./superchain
1515
# Building jsii itself within the Docker image
16-
- docker run --rm -it --net=host -v ${PWD}:${PWD} -w ${PWD} jsii/superchain:nightly ./build.sh
16+
- docker run --rm -it --net=host -v ${PWD}:${PWD} -w ${PWD} jsii/superchain:nightly npm run build
1717
# Make sure the build did not change the source tree
1818
- git update-index --refresh
1919
- git diff-index --exit-code --stat HEAD

CONTRIBUTING.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $ cd jsii # go to the root of the jsii repo
4848
$ docker run --rm --net=host -it -v $PWD:$PWD -w $PWD ${IMAGE}
4949
```
5050

51-
You can then run `./build.sh` as described below.
51+
You can then run `npm run build` as described below.
5252

5353
## Getting Started
5454
### Bootstrapping
@@ -59,7 +59,7 @@ The project is managed as a [monorepo] using [lerna].
5959
[lerna]: https://github.com/lerna/lerna
6060

6161
1. Check out this repository.
62-
2. Run `./build.sh` to install lerna, bootstrap the repository and perform an
62+
2. Run `npm run build` to install lerna, bootstrap the repository and perform an
6363
initial build and test cycle.
6464

6565
### Development Workflow
@@ -78,20 +78,23 @@ Each one of these scripts can be executed either from the root of the repo using
7878

7979
### Bump
8080

81-
To bump the version of this repository, use the [`./bump.sh`](./bump.sh) script.
81+
To bump the version of this repository, use the [`npm run bump`] script.
82+
83+
[`npm run bump`]: ./scripts/bump.sh
8284

8385
### Packaging and Bundling
8486

85-
This repository emits artifacts in multiple languages. The
86-
[`pack.sh`](./pack.sh) and [`bundle.sh`](./bundle.sh) scripts are used to
87-
prepare the repository for publishing.
87+
This repository emits artifacts in multiple languages. The [`npm run package`]
88+
script is used to prepare the repository for publishing.
89+
90+
[`npm run package`]: ./scripts/package.sh
8891

8992
Each module that needs to be published implements an npm script called `package`
9093
which emits publishable artifacts to `dist/<lang>` (e.g. `dist/dotnet` for
9194
NuGet, `dist/js` for npm, `dist/java` for Maven Central). All those "dist"
9295
directories are merged into a single .zip file that is later on used in our
93-
CI/CD publishing tasks. Each `lang` directory is published to the respective
94-
repository.
96+
CI/CD publishing tasks. Each `<lang>` directory is published to the respective
97+
package repository.
9598

9699
## Implementing Language Bindings
97100

buildspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ version: 0.2
33
phases:
44
install:
55
commands:
6-
- /bin/bash ./install.sh
6+
- npm run bootstrap
77
pre_build:
88
commands:
9-
- /bin/bash ./fetch-dotnet-snk.sh
9+
- npm run fetch-dotnet-snk
1010
build:
1111
commands:
12-
- /bin/bash ./build.sh
12+
- npm run build
1313
post_build:
1414
commands:
15-
- "[ -f .BUILD_COMPLETED ] && /bin/bash ./pack.sh"
15+
- '[ ${CODEBUILD_BUILD_SUCCEEDING} = 1 ] && npm run package'
1616
artifacts:
1717
files:
1818
- "**/*"

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
{
2-
"private": true,
3-
"license": "Apache-2.0",
4-
"devDependencies": {
5-
"@types/node": "^8.10.51",
6-
"lerna": "^3.16.4",
7-
"nodeunit": "^0.11.3",
8-
"nyc": "^14.1.1",
9-
"tslint": "^5.18.0",
10-
"typescript": "^3.5.3"
11-
},
12-
"repository": {
13-
"type": "git",
14-
"url": "https://github.com/aws/jsii.git"
15-
}
2+
"private": true,
3+
"license": "Apache-2.0",
4+
"scripts": {
5+
"bootstrap": "bash scripts/bootstrap.sh",
6+
"build": "bash scripts/build.sh",
7+
"bump": "bash scripts/bump.sh",
8+
"fetch-dotnet-snk": "bash scripts/fetch-dotnet-snk.sh",
9+
"install-local-packages": "node scripts/install-local-packages.js",
10+
"package": "bash scripts/package.sh"
11+
},
12+
"devDependencies": {
13+
"@types/node": "^8.10.51",
14+
"lerna": "^3.16.4",
15+
"nodeunit": "^0.11.3",
16+
"nyc": "^14.1.1",
17+
"tslint": "^5.18.0",
18+
"typescript": "^3.5.3"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "https://github.com/aws/jsii.git"
23+
}
1624
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

install.sh renamed to scripts/bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ lerna bootstrap --reject-cycles --ci
2222

2323
echo "============================================================================================="
2424
echo "installing local links..."
25-
node scripts/install-local-deps.js
25+
npm run install-local-packages

0 commit comments

Comments
 (0)