Skip to content

Commit

Permalink
Make /lib in deep import paths optional
Browse files Browse the repository at this point in the history
  • Loading branch information
slikts committed Aug 8, 2019
1 parent 760f545 commit b5a028c
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 18 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
*.log
node_modules
lib
es6
dev
.idea
coverage
Expand Down
94 changes: 82 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
"prettier": "prettier --list-different \"./{src,test,tutorials}/**/*.ts\"",
"fix-prettier": "prettier --write \"./{src,test,tutorials}/**/*.ts\"",
"test": "npm run lint && npm run prettier && npm run dtslint && npm run jest-clear-cache && npm run jest && npm run docs",
"clean": "rimraf lib/* es6/*",
"clean": "shx rm -rf lib/*",
"build": "npm run clean && tsc && tsc -p tsconfig.es6.json",
"prepublish": "npm run build",
"postbuild": "mkdir lib/lib && shx cp -R lib/*.{ts,js} lib/lib && shx cp {LICENSE,*.md} lib && ./scripts/prepare.js",
"prepublishOnly": "echo Use 'npm run publish' instead && exit 1",
"publish": "npm publish lib",
"prepare": "npm run build",
"doctoc": "doctoc README.md docs/introduction/code-conventions.md --title \"**Table of contents**\"",
"mocha": "mocha -r ts-node/register test/*.ts",
"dtslint": "dtslint dtslint",
Expand Down Expand Up @@ -53,7 +56,7 @@
"jest": "^24.8.0",
"mocha": "^5.2.0",
"prettier": "^1.18.2",
"rimraf": "2.6.2",
"shx": "^0.3.2",
"ts-jest": "^24.0.2",
"ts-node": "^8.0.2",
"ts-simple-ast": "17.1.1",
Expand All @@ -71,5 +74,6 @@
"algebraic-data-types",
"functional-programming"
],
"dependencies": {}
"dependencies": {},
"private": true
}
11 changes: 11 additions & 0 deletions scripts/prepare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env node

const fs = require('fs');

const package = Object.assign({}, require('../package.json'), {
private: false,
scripts: {},
files: ['*'],
});

fs.writeFileSync('lib/package.json', JSON.stringify(package, null, 2));
2 changes: 1 addition & 1 deletion tsconfig.es6.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./es6",
"outDir": "./lib/es6",
"module": "es6"
}
}

0 comments on commit b5a028c

Please sign in to comment.