-
Notifications
You must be signed in to change notification settings - Fork 86
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
ci: set check_latest to true #363
Conversation
Windows tests are failing on Node.js 16, looking into the failures and it suggests the plugin is not compatible with Node.js 16 + Windows |
a8df756
to
502ec5e
Compare
502ec5e
to
9916c61
Compare
@@ -22,15 +22,13 @@ const handleFileTracking = ({ functionsPath, publishPath }) => { | |||
const trackingFile = readFileSync(trackingFilePath, 'utf8') | |||
const [trackedFunctions, trackedPublish] = trackingFile.split(TRACKING_FILE_SEPARATOR) | |||
const cleanConfiguredFiles = (trackedFiles, dirPath) => { | |||
trackedFiles.forEach((file) => { | |||
const filePath = join(dirPath, file.trim('\r')) |
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.
Not sure I understand the original code. trim
doesn't accept an argument. Also recursive: true
is not supported for Node.js 10.
Finally I'm not sure why we need rmdirSync
on Windows since removeSync does the same without failing on non existent files.
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.
basically this work was trial and error on windows when i first did it. it was just to get a bandaid solution out so plugin users could even SORTOF use the CLI, in lieu of a CLI-based solution like having plugins build into a sep dir (instead of changing their src). if all the tests pass still with this diff then thats great!!
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.
Sorry I should have been more clear. trim('\r')
is the same as trim()
as trim
doesn't accept an argument.
@@ -22,15 +22,13 @@ const handleFileTracking = ({ functionsPath, publishPath }) => { | |||
const trackingFile = readFileSync(trackingFilePath, 'utf8') | |||
const [trackedFunctions, trackedPublish] = trackingFile.split(TRACKING_FILE_SEPARATOR) | |||
const cleanConfiguredFiles = (trackedFiles, dirPath) => { | |||
trackedFiles.forEach((file) => { | |||
const filePath = join(dirPath, file.trim('\r')) | |||
if (file !== '') { |
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'm not sure but the intention here might be to check the trimmed version of file
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.
trackingFile.split would sometimes insert '' into trackedFiles; this is just to skip that
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.
in these cases, with file === '', it removes the current dir
if (process.platform === 'win32') { | ||
rmdirSync(filePath, { recursive: true }) | ||
} | ||
trackedFiles |
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.
@lindsaylevine can you approve this change?
@@ -22,15 +22,13 @@ const handleFileTracking = ({ functionsPath, publishPath }) => { | |||
const trackingFile = readFileSync(trackingFilePath, 'utf8') | |||
const [trackedFunctions, trackedPublish] = trackingFile.split(TRACKING_FILE_SEPARATOR) | |||
const cleanConfiguredFiles = (trackedFiles, dirPath) => { | |||
trackedFiles.forEach((file) => { | |||
const filePath = join(dirPath, file.trim('\r')) |
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.
basically this work was trial and error on windows when i first did it. it was just to get a bandaid solution out so plugin users could even SORTOF use the CLI, in lieu of a CLI-based solution like having plugins build into a sep dir (instead of changing their src). if all the tests pass still with this diff then thats great!!
@@ -22,15 +22,13 @@ const handleFileTracking = ({ functionsPath, publishPath }) => { | |||
const trackingFile = readFileSync(trackingFilePath, 'utf8') | |||
const [trackedFunctions, trackedPublish] = trackingFile.split(TRACKING_FILE_SEPARATOR) | |||
const cleanConfiguredFiles = (trackedFiles, dirPath) => { | |||
trackedFiles.forEach((file) => { | |||
const filePath = join(dirPath, file.trim('\r')) | |||
if (file !== '') { |
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.
trackingFile.split would sometimes insert '' into trackedFiles; this is just to skip that
@@ -22,15 +22,13 @@ const handleFileTracking = ({ functionsPath, publishPath }) => { | |||
const trackingFile = readFileSync(trackingFilePath, 'utf8') | |||
const [trackedFunctions, trackedPublish] = trackingFile.split(TRACKING_FILE_SEPARATOR) | |||
const cleanConfiguredFiles = (trackedFiles, dirPath) => { | |||
trackedFiles.forEach((file) => { | |||
const filePath = join(dirPath, file.trim('\r')) | |||
if (file !== '') { |
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.
in these cases, with file === '', it removes the current dir
} | ||
trackedFiles | ||
.map((file) => file.trim()) | ||
.filter(Boolean) |
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.
is this effectively the same thing as if (file !== '')
?
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.
In the original code if (file !== '')
is the original non trimmed value (trim
doesn't mutate the string), so the check should be if (file.trim() !== '')
.
filter(Boolean)
operates on the trimmed value.
Thanks for the review @lindsaylevine |
* fix: import server in module scope * chore: rmeove comment
Follow up on #328