Skip to content

Commit e72fea5

Browse files
authored
feat(jsii): Enforce use of peerDependencies (#421)
Any direct dependency to another jsii module must be recorded as a peerDependency as well, guaranteeing a consistent behavior of dependencies across all possible jsii runtimes. BREAKING CHANGE: All direct dependencies must be duplicated in peerDependencies unless they are in bundledDependencies. Fixes #361
1 parent 42dece1 commit e72fea5

File tree

24 files changed

+177
-150
lines changed

24 files changed

+177
-150
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules/
22
.BUILD_COMPLETED
33
lerna-debug.log
4+
tsconfig.tsbuildinfo
45
.DS_Store
56
.idea
67
.vs

packages/codemaker/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
77
"scripts": {
8-
"build": "tsc",
9-
"watch": "tsc -w",
8+
"build": "tsc --build",
9+
"watch": "tsc --build -w",
1010
"test": "nodeunit test/test.*.js",
1111
"package": "rm -fr dist/js && mkdir -p dist/js && mv $(npm pack) dist/js"
1212
},

packages/codemaker/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"noUnusedLocals": true, /* Report errors on unused locals. */
1313
"noUnusedParameters": true, /* Report errors on unused parameters. */
1414
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
15-
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */
15+
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
16+
"composite": true
1617
}
1718
}

packages/jsii-dotnet-jsonmodel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"types": "lib/index.d.ts",
88
"scripts": {
99
"gen": "/bin/bash ./generate.sh",
10-
"build": "tsc && /bin/bash ./build.sh",
10+
"build": "tsc --build && /bin/bash ./build.sh",
1111
"test": "/bin/bash ./test.sh",
1212
"package": "package-dotnet"
1313
},

packages/jsii-dotnet-runtime-test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"private": true,
88
"scripts": {
99
"gen": "/bin/bash ./generate.sh",
10-
"build": "npm run gen && tsc && /bin/bash ./build.sh",
10+
"build": "npm run gen && tsc --build && /bin/bash ./build.sh",
1111
"test": "/bin/bash ./test.sh"
1212
},
1313
"devDependencies": {

packages/jsii-dotnet-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"types": "lib/index.d.ts",
88
"scripts": {
99
"gen": "/bin/bash ./generate.sh",
10-
"build": "npm run gen && tsc && /bin/bash ./build.sh",
10+
"build": "npm run gen && tsc --build && /bin/bash ./build.sh",
1111
"test": "/bin/bash ./test.sh",
1212
"package": "package-dotnet"
1313
},

packages/jsii-java-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"private": true,
88
"scripts": {
99
"gen": "/bin/bash ./generate.sh",
10-
"build": "tsc && npm run gen && cd project && mvn deploy -D altDeploymentRepository=local::default::file://${PWD}/../maven-repo",
10+
"build": "tsc --build && npm run gen && cd project && mvn deploy -D altDeploymentRepository=local::default::file://${PWD}/../maven-repo",
1111
"test": "echo 'Tests are run as part of the build target'",
1212
"package": "package-java"
1313
},

packages/jsii-kernel/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
77
"scripts": {
8-
"build": "tsc && tslint -p .",
9-
"watch": "tsc -w",
8+
"build": "tsc --build && tslint -p .",
9+
"watch": "tsc --build -w",
1010
"lint": "tslint -p . --force",
1111
"test": "nodeunit test/test.*.js",
1212
"package": "package-js"

packages/jsii-kernel/tsconfig.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@
4848
"inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
4949

5050
/* Experimental Options */
51-
"experimentalDecorators": true /* Enables experimental support for ES7 decorators. */
51+
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
5252
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
53-
}
53+
"composite": true
54+
},
55+
"include": ["**/*.ts"],
56+
"references": [{
57+
"path": "../jsii-spec"
58+
}]
5459
}

packages/jsii-pacmak/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"types": "lib/index.d.ts",
1010
"scripts": {
1111
"gen": "/bin/bash generate.sh",
12-
"build": "npm run gen && tsc && chmod +x bin/jsii-pacmak && tslint -p .",
13-
"watch": "tsc -w",
12+
"build": "npm run gen && tsc --build && chmod +x bin/jsii-pacmak && tslint -p .",
13+
"watch": "tsc --build -w",
1414
"lint": "tslint -p . --force",
1515
"test": "/bin/bash test/diff-test.sh && /bin/bash test/build-test.sh",
1616
"package": "package-js"

0 commit comments

Comments
 (0)