-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add prepublish script and change main #398
Conversation
@@ -6,7 +6,7 @@ | |||
"test", | |||
".gitignore" | |||
], | |||
"main": "dist/xterm.js", | |||
"main": "out/xterm.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you leave this as dist/xterm.js
please, since the browserify case is not our main use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course.
But that would entail that you could never use require('xterm')
in Node, as we have seen. You would always have to write something like require('xterm/out/xterm.js')
which isn't really that pretty. Also, I see no downside with letting main to point to the out/xterm.js
. It would still work in the browser using the ´<script src="node_modules/dist/xterm.js"></script>` tag and it would work natively in node..
@@ -32,6 +32,7 @@ | |||
"start": "nodemon --watch src --watch addons --watch demo --exec bash -c './bin/build && node demo/app'", | |||
"test": "./bin/build && mocha --recursive ./out", | |||
"build:docs": "jsdoc -c jsdoc.json", | |||
"build": "./bin/build" | |||
"build": "./bin/build", | |||
"prepublish": "./bin/build" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you can use just tsc
here? /cc @Tyriar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you are right
Thanks for your contribution @budde377! The proposal is pretty good. Being able to also require the built pre-bundled JavaScript files can definitely have it's use cases. Now if we decide to ship these files in npm's xterm.js distribution, maybe it's a good idea to change the name of TypeScript's output directory to @Tyriar any thoughts on this? |
That would entail committing |
You can release a sub-folder on npm without committing it, using |
@blink1073 didn't know about that |
@Tyriar what's your opinion on publishing |
@parisk whatever we can do to keep compiled files out of the master branch is good imo, so if it works 👍 |
Are you guys sure that you want to keep the entrypoint for npm to be |
If we use |
I agree.
…On Mon, Dec 12, 2016, 21:57 Daniel Imms ***@***.***> wrote:
If we use files in package.json then I think we should change it to point
at lib/xterm.js
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#398 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADVCyze58GWKktKjtzFpF0VAqeoEn08Pks5rHbUtgaJpZM4LIwMJ>
.
|
It's worth bringing up (again) that if we don't need to check in |
19940f9
to
12755af
Compare
Building TS before publish and pointing the main entry to the builded files.
@parisk Done |
Works great, thanks! |
Woo! Great result 😄 |
Yes! Thank you so much for this. |
Having the same issue. Despite having this merged I don't understand what I need to do when using browserify to require xterm in my project. Is this what I need to do in my index.js file?
|
Building TS before publish and pointing the main entry to the builded files.
Closes #397