-
Notifications
You must be signed in to change notification settings - Fork 62
Add Typescript deps and build #148
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 Typescript deps and build #148
Conversation
|
Nice - you've already addressed a concern that I had about including the build directory. I want to research how best to publish a typescript based app
I don't know enough about JS testing so what is the reason for changing the test suite? |
7c89d07 to
985afa4
Compare
RE: JS/TS - the JS projects will import RE: Test frameworks, Jest has some easy TS integrations, and a nice coverage option. |
|
@simonh1000 lmk if you have any other feedback - I've got a few more PRs to get this TS conversion over the line. |
|
I'll try to take a look at the weekend |
src/ftp-deploy.spec.js
Outdated
| return statP(remoteDir + "/test-inside-root.txt"); | ||
| }) | ||
| .catch((err) => done(err)); | ||
| .catch((err) => Promise.reject(err)); |
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.
we do not need this line at all then?
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.
removed
|
I tried to run the tests and got |
test/server.js
Outdated
| const port = 2121; | ||
| const homeDir = | ||
| require("os").homedir() + "/code/projects/ftp-deploy/test/remote"; | ||
| const homeDir = path.join(__dirname, "../test/remote"); |
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 made this change so that people on windows could run the tests - is there a reason for deleting it?
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.
Yes, my code is in ~/src. What if we used require("os").tmpdir() instead?
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.
Actually, if I'm not mistaken, making this consistent with this should work the same on windows/mac node?
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 we revert this change please. I explained why before
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.
Yes, reverted.
|
to be honest it feels strange to add all this typescript config stuff without there being any typescript code yet. If I merged and someone was to look at the repo then, they would wonder what on earth is happening. Can we add the TS config with at least some TS code? |
I was able to run the tests after pulling, and |
Agreed. What if we used this as a base branch to merge all the subsequent TS PRs into? |
bb5d9f1 to
c170e24
Compare
I tried again with the same issue. I think you have a global install (of ts-node?) that i do not have |
I was able to repro the error with this (after removing the global install of and verify that it was fixed with this |
|
@simonh1000 let me know if you have any updates |
| .then(() => { | ||
| // Should reject if file does not exist | ||
| return statP(remoteDir + "/test-inside-root.txt"); | ||
| }) |
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.
what is the intention here?
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.
removed this, it was an unnecessary change
…p-deploy into typescript-build-deps
test/server.js
Outdated
| const port = 2121; | ||
| const homeDir = | ||
| require("os").homedir() + "/code/projects/ftp-deploy/test/remote"; | ||
| const homeDir = path.join(__dirname, "../test/remote"); |
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.
Yes, my code is in ~/src. What if we used require("os").tmpdir() instead?
test/server.js
Outdated
| const port = 2121; | ||
| const homeDir = | ||
| require("os").homedir() + "/code/projects/ftp-deploy/test/remote"; | ||
| const homeDir = path.join(__dirname, "../test/remote"); |
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.
Actually, if I'm not mistaken, making this consistent with this should work the same on windows/mac node?
src/ftp-deploy.spec.js
Outdated
| return statP(remoteDir + "/test-inside-root.txt"); | ||
| }) | ||
| .catch((err) => done(err)); | ||
| .catch((err) => Promise.reject(err)); |
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.
removed
test/server.js
Outdated
| const port = 2121; | ||
| const homeDir = | ||
| require("os").homedir() + "/code/projects/ftp-deploy/test/remote"; | ||
| const homeDir = path.join(__dirname, "../test/remote"); |
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.
Yes, reverted.
| .then(() => { | ||
| // Should reject if file does not exist | ||
| return statP(remoteDir + "/test-inside-root.txt"); | ||
| }) |
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.
removed this, it was an unnecessary change
|
@simonh1000 sorry for the delays on this - lmk if you have more feedback |
|
Thanks - I will take a look soon but things are a bit busy at the weekend, which is the only time I have available for open source. Thansk for your patience |
Any updates on this? |
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.
please don't remove this file
| const path = require("path"); | ||
| var assert = require("assert"); | ||
|
|
||
| const expect = require("chai").expect; |
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.
please do not change test framework without further justification
| @@ -0,0 +1,9 @@ | |||
| import type { Config } from "@jest/types"; | |||
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.
please dont change test framework in a PR about typescript
simonh1000
left a comment
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.
See comments below - let's stay focused on the TS part
|
closing in favor of #170 |
Overview
Preparation for Typescript
tsconfigProgress towards closing #136
Checks
✅
npm test✅
npm linkinto my app and successfully deployed