Revert typescript migration for core/src/Site/index #2331
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
Overview of changes:
Fix discovered issue of markbind deploy failure after v5 release.
After migrating to v5,
markbind deploy
will result in the following error:I could not figure out the root cause for this at the moment, but I suspect it's due to the following packages: gh-pages or simple-git.
After revisiting different commits in the git history, I found out that markbind deploy still works in this commit: c4bda22
The PR that broke the deploy functionality seems to be #2270 Migrate Site/index.js to TypeScript. Out of all the changes within the PR, the update of index.js to index.ts seems to be causing the problem. Therefore, I am reverting the change by:
To revert index.js, I directly copied from the version before the migrating in #2270, and only adjusted a few lines of code within to accommodate later changes that impacted this file. They are:
They are found from inspecting the history of changes for index.ts file, at here
Anything you'd like to highlight/discuss:
We should definitely look into the original typescript migration and figure out the exact lines that cause this issue.
Side note, I noticed we updated @types/gh-pages to v3 in the original index.ts migration, however we are still using gh-pages@v2. Was wondering if that is the root cause but nope, updating that doesn't help.
Testing instructions:
To see the problem:
To see the fix:
The two sites at https://markbind.org/ and https://markbind.org/devdocs/devGuide/devGuide.html are deployed using this PR branch, can also verify the output by looking around in there.
Proposed commit message: (wrap lines at 72 characters)
Revert typescript migration for core/src/Site/index
The migration of Site/index.ts to Site/index.js is causing markbind
deploy command to fail with an unexpected error.
Let's first fully revert the migration for index.ts and further investigate
to find ways to migrate this file again.
The index.ts contain way too much content to be able to dissect immediately.
We should provide this work around first as markbind deploy is quite
essential for users that publish their website using this command.
Checklist: ☑️