diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..2e6d45e2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules +dist +results +.nyc_output +*.tsbuildinfo diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..68c82b71 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 Andrei Picus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..e69de29b diff --git a/lerna.json b/lerna.json new file mode 100644 index 00000000..a2bb50ba --- /dev/null +++ b/lerna.json @@ -0,0 +1,6 @@ +{ + "packages": [ + "packages/*" + ], + "version": "independent" +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..d7bca78c --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "lerna-ts", + "private": true, + "scripts": { + "bootstrap": "lerna bootstrap --hoist", + "clean": "lerna run clean", + "build": "lerna run build", + "pub": "lerna publish" + }, + "devDependencies": { + "lerna": "~3.14.0", + "typescript": "~3.4.5" + } +} diff --git a/packages/bar/package.json b/packages/bar/package.json new file mode 100644 index 00000000..c97d0bad --- /dev/null +++ b/packages/bar/package.json @@ -0,0 +1,20 @@ +{ + "name": "@nighttrax/bar", + "version": "1.0.0", + "main": "dist/index", + "types": "dist/index", + "files": [ + "dist" + ], + "scripts": { + "build": "npm run clean && npm run compile", + "clean": "rm -rf ./dist && rm -rf tsconfig.build.tsbuildinfo", + "compile": "tsc -b tsconfig.build.json" + }, + "dependencies": { + "@nighttrax/foo": "^1.0.0" + }, + "devDependencies": { + "typescript": "~3.4.5" + } +} diff --git a/packages/bar/src/index.ts b/packages/bar/src/index.ts new file mode 100644 index 00000000..0e0cf312 --- /dev/null +++ b/packages/bar/src/index.ts @@ -0,0 +1,3 @@ +import meaningOfLife from '@nighttrax/foo'; + +console.log(meaningOfLife); diff --git a/packages/bar/tsconfig.build.json b/packages/bar/tsconfig.build.json new file mode 100644 index 00000000..7c2797c4 --- /dev/null +++ b/packages/bar/tsconfig.build.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.json", + + "compilerOptions": { + "composite": true, + "declaration": true, + "outDir": "./dist", + "rootDir": "./src" + }, + + "references": [{ + "path": "../foo/tsconfig.build.json" + }], + + "include": [ + "src/**/*" + ] +} diff --git a/packages/bar/tsconfig.json b/packages/bar/tsconfig.json new file mode 100644 index 00000000..5bd0b1fe --- /dev/null +++ b/packages/bar/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + + "include": [ + "src/**/*" + ] +} diff --git a/packages/foo/package.json b/packages/foo/package.json new file mode 100644 index 00000000..be3655ba --- /dev/null +++ b/packages/foo/package.json @@ -0,0 +1,17 @@ +{ + "name": "@nighttrax/foo", + "version": "1.0.0", + "main": "dist/index", + "types": "dist/index", + "files": [ + "dist" + ], + "scripts": { + "build": "npm run clean && npm run compile", + "clean": "rm -rf ./dist && rm -rf tsconfig.build.tsbuildinfo", + "compile": "tsc -b tsconfig.build.json" + }, + "devDependencies": { + "typescript": "~3.4.5" + } +} diff --git a/packages/foo/src/index.ts b/packages/foo/src/index.ts new file mode 100644 index 00000000..e41af340 --- /dev/null +++ b/packages/foo/src/index.ts @@ -0,0 +1,3 @@ +const meaningOfLife = 42; + +export default meaningOfLife; diff --git a/packages/foo/tsconfig.build.json b/packages/foo/tsconfig.build.json new file mode 100644 index 00000000..56fdc9cb --- /dev/null +++ b/packages/foo/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.json", + + "compilerOptions": { + "composite": true, + "declaration": true, + "outDir": "./dist", + "rootDir": "./src" + }, + + "include": [ + "src/**/*" + ] +} diff --git a/packages/foo/tsconfig.json b/packages/foo/tsconfig.json new file mode 100644 index 00000000..5bd0b1fe --- /dev/null +++ b/packages/foo/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + + "include": [ + "src/**/*" + ] +} diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 00000000..d7b52afe --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "sourceMap": true + }, + + "exclude": [ + "node_modules", + "dist" + ] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..da854aaf --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.build.json", + + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@nighttrax/*": ["packages/*/src"] + } + } +}