Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make /lib in deep import paths optional #926

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 run prepare && 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"
}
}