-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Island rhythms/cleanup #14102
Island rhythms/cleanup #14102
Conversation
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 this could be cleaned-up even more by relying on the versionObj
like the generation of the website
also if all the logic is now in website.js
for docs:clean:stable
, shouldnt the script also be changed to use that instead (so we dont have duplicate actions)
if you want you can merge it as-is and i will try to update it with versionObj
later
@hasezoey I addressed your comments, can you please re-review? |
scripts/website.js
Outdated
const foldersToClean = [ | ||
'./docs', | ||
'./docs/tutorials', | ||
'./docs/typescript', | ||
'./docs/api', | ||
'./docs/source/_docs', |
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.
those would likely need to be prefixed with versionObj.versionedPath
(guessing by this workflow and how this function is always called)
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 don't think these paths need to be prefixed with versionedPath
. This deleteAllHtmlFiles()
function is meant to replace npm run docs:clean:stable
; which cleans out index.html
, docs/*.html
, etc. regardless of whether this is a versioned deploy or not.
In other words, the workflow for a versioned deploy is 1) clear all docs, 2) generate docs, 3) copy docs to /tmp
, 4) clear versionedPath
, 5) copy /tmp
to versionedPath
. deleteAllHtmlFiles()
takes care of step 1, not step 4.
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 don't think these paths need to be prefixed with versionedPath. This deleteAllHtmlFiles() function is meant to replace npm run docs:clean:stable; which cleans out index.html, docs/*.html, etc. regardless of whether this is a versioned deploy or not.
is because of the git conflict if those files exist and you want to change to gh-pages
?
if this is the case, could you add some kind of comment / JSDOC for future reference (on why it does not make use of versionedPath
)
but because this is now a function of website.js
, shouldnt it also at least try to clean the versionedPath
to have a consistent new generation?
In other words, the workflow for a versioned deploy is 1) clear all docs, 2) generate docs, 3) copy docs to /tmp, 4) clear versionedPath, 5) copy /tmp to versionedPath. deleteAllHtmlFiles() takes care of step 1, not step 4.
just to be on a consistent page, this is the current workflow (to my understanding)
- if latest, checkout
gh-pages
- if latest, merge
master
- if latest, clean
/docs
directoy - website.js is called
- website.js will clean out the already generated files (if they exist) for the latest / unversioned deploy (to reduce the git conflicts?)
- website.js will generate all files directly to
versionedPath
(pugify
) - website.js will copy all static files directly to
versionedPath
, if not empty (because it does not need to copy in-place) - website.js if environment variable
DOCS_DEPLOY
is set, files inversionedPath
will be moved totmp
(which is currently a bug, see my suggestion for when the function is called) - if versioned, the branch
gh-pages
is checked-out - if versioned, will delete the old
/docs/X.X
folder - if versioned, will copy folder
tmp
to theX.X
- if latest, generate search
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 because of the git conflict if those files exist and you want to change to gh-pages? No, more to guard against silently out of date files and get rid of any files that we don't want to generate any more.
just to be on a consistent page, this is the current workflow (to my understanding) Not entirely correct. 7.x and 6.x workflows don't check out gh-pages, so no steps 1/2. But otherwise correct.
Re: Step 6, you're right, because website.js
will generate all files directly to versionedPath, we do need to make deleteAllHtmlFiles()
relative to versionedPath
.
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.
just to be on a consistent page, this is the current workflow (to my understanding) Not entirely correct. 7.x and 6.x workflows don't check out gh-pages, so no steps 1/2. But otherwise correct.
as it said if latest
- which applies to the master branch (currently 8.x) and if versioned
it means the X.x
branches (like 7.x
and 6.x
) - versioned uses gh-pages checkout at step 9
…, handle ENOENT error, consistently check for truthy DOCS_DEPLOY
scripts/website.js
Outdated
const foldersToClean = [ | ||
'./docs', | ||
'./docs/tutorials', | ||
'./docs/typescript', | ||
'./docs/api', | ||
'./docs/source/_docs', |
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 don't think these paths need to be prefixed with versionedPath. This deleteAllHtmlFiles() function is meant to replace npm run docs:clean:stable; which cleans out index.html, docs/*.html, etc. regardless of whether this is a versioned deploy or not.
is because of the git conflict if those files exist and you want to change to gh-pages
?
if this is the case, could you add some kind of comment / JSDOC for future reference (on why it does not make use of versionedPath
)
but because this is now a function of website.js
, shouldnt it also at least try to clean the versionedPath
to have a consistent new generation?
In other words, the workflow for a versioned deploy is 1) clear all docs, 2) generate docs, 3) copy docs to /tmp, 4) clear versionedPath, 5) copy /tmp to versionedPath. deleteAllHtmlFiles() takes care of step 1, not step 4.
just to be on a consistent page, this is the current workflow (to my understanding)
- if latest, checkout
gh-pages
- if latest, merge
master
- if latest, clean
/docs
directoy - website.js is called
- website.js will clean out the already generated files (if they exist) for the latest / unversioned deploy (to reduce the git conflicts?)
- website.js will generate all files directly to
versionedPath
(pugify
) - website.js will copy all static files directly to
versionedPath
, if not empty (because it does not need to copy in-place) - website.js if environment variable
DOCS_DEPLOY
is set, files inversionedPath
will be moved totmp
(which is currently a bug, see my suggestion for when the function is called) - if versioned, the branch
gh-pages
is checked-out - if versioned, will delete the old
/docs/X.X
folder - if versioned, will copy folder
tmp
to theX.X
- if latest, generate search
Co-authored-by: hasezoey <[email protected]>
Co-authored-by: hasezoey <[email protected]>
Co-authored-by: hasezoey <[email protected]>
path.join('.', versionObj.versionedPath, 'docs'), | ||
path.join('.', versionObj.versionedPath, 'docs', 'tutorials'), | ||
path.join('.', versionObj.versionedPath, 'docs', 'typescript'), | ||
path.join('.', versionObj.versionedPath, 'docs', 'api'), | ||
path.join('.', versionObj.versionedPath, 'docs', 'source', '_docs'), |
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.
as a suggestion, you should probably not use '.'
and use variable cwd
instead
Summary
The
docs:prepare:publish:XYZ
scripts are becoming hard to maintain and test. This cleans things up a bit so at least the logic fromdocs:clean:stable
andmv ./docs/7.x ./tmp
are moved to thewebsite.js
script. So the actions that don't change the branch are in one script.Examples