-
Notifications
You must be signed in to change notification settings - Fork 164
updated node version and other packages #1341
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
Conversation
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
1 similar comment
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
1 similar comment
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
@@ -1,3 +1,6 @@ | |||
/* eslint-disable no-implicit-globals, strict */ | |||
/* global SITE_BASE_URL, SITE_GITOPS_COLLECTION, SITE_IS_GITOPS_COLLECTION */ | |||
|
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 didn't change any logic in this file, only linter fixes
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
@import "../../node_modules/bootstrap/scss/variables"; | ||
|
||
//@import "../../scss/mixins"; | ||
@import "../../node_modules/bootstrap/scss/mixins"; |
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.
@import is deprecated
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
.babelrc.js
Outdated
@@ -1,16 +1,13 @@ | |||
module.exports = { | |||
presets: [ | |||
[ | |||
'@babel/env', | |||
'@babel/preset-env', |
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.
Let's consider removing this completely.
Same as our main app is targeted for ES2022 - we don't need this extra layer at this point.
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.
the only thing I could do is replace it with @babel/eslint-parser. Our code is already written in an old style and we need to support it
assets/js/argohub-redirect.js
Outdated
|
||
location.href = argoHubRedirectURL | ||
} | ||
|
||
async function fetchRedirectMap() { | ||
const response = await fetch(`${SITE_BASE_URL}/assets/js/src/argohub-redirect-mapping.json`) | ||
const response = await fetch(`${SITE_BASE_URL}/assets/js/argohub-redirect-mapping.json`) |
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.
Let's keep this file in this folder and also minify it as well is possible.
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.
uglify does not minimize json files. I can only try to write my own script for that
assets/js/argohub-redirect.js
Outdated
@@ -64,6 +72,7 @@ function toggleSegmentDropdown() { | |||
select.classList.toggle('open') | |||
} | |||
|
|||
// eslint-disable-next-line no-unused-vars |
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 find a way to avoid this exception?
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.
for some reason eslint doesn't see that we use it on template. mostly I think because we use inline html functions and this is not a best practice
assets/js/argohub-redirect.js
Outdated
const pathname = window.location.pathname | ||
const currentPath = pathname.replace(SITE_BASE_URL, '') | ||
|
||
if (selectedValue === 'enterprise') { | ||
removeGitOpsDocumentationCookie() | ||
|
||
const enterprisePath = Object.keys(redirectMap).find((key) => redirectMap[key] === currentPath) | ||
const enterprisePath = Object.keys(redirectMap).find( |
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.
Let's add a .prettierrc
file from our main app to this repo.
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 added this file, and added a configuration command in package json, but I didn't include changes it makes because there are too many file changes. I think I'll need to do that in separate pr
assets/js/argohub-redirect.js
Outdated
@@ -149,6 +134,39 @@ async function selectSegmentOption(option, selectedValue) { | |||
} | |||
} | |||
|
|||
// eslint-disable-next-line no-unused-vars |
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 avoid this exception?
assets/js/argohub-redirect.min.js
Outdated
@@ -0,0 +1,7 @@ | |||
/* eslint-disable no-implicit-globals, strict */ | |||
/* global SITE_BASE_URL, SITE_GITOPS_COLLECTION, SITE_IS_GITOPS_COLLECTION */ | |||
let GITOPS_DOC_COOKIE="cfdoctype=gitops",IS_GITOPS_DOC_COOKIE_SET=document.cookie.includes(GITOPS_DOC_COOKIE);async function getArgoHubRedirectURL(e){e=e.replace(SITE_BASE_URL,"");var t=(await fetchRedirectMap())[e];return t?t===`/${SITE_GITOPS_COLLECTION}/`?""+location.href+SITE_GITOPS_COLLECTION:location.href.replace(e,t):null}async function handleRedirect(){var e;!SITE_IS_GITOPS_COLLECTION&&IS_GITOPS_DOC_COOKIE_SET&&(e=await getArgoHubRedirectURL(location.pathname))&&(location.href=e)}async function fetchRedirectMap(){var e=await fetch(SITE_BASE_URL+"/assets/js/argohub-redirect-mapping.json");if(e.ok)return e.json();throw new Error("Failed to fetch the collections redirect map.")}function setGitOpsDocumentationCookie(){configureGitOpsDocumentationCookie(2592e3)}function removeGitOpsDocumentationCookie(){configureGitOpsDocumentationCookie(0)}function configureGitOpsDocumentationCookie(e){let t=GITOPS_DOC_COOKIE+`; Max-Age=${e}; Path=/; SameSite=Strict`;"https:"===location.protocol&&(t+="; Secure"),"codefresh.io"===location.hostname&&(t+="; Domain=.codefresh.io"),document.cookie=t}function toggleSegmentDropdown(){document.querySelector(".custom-select").classList.toggle("open")} |
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.
Need to find why it's converted from const
to let
assets/scss/_variables.scss
Outdated
@@ -152,3 +149,5 @@ $ant-select-option-hover-color: #454661; | |||
$ant-select-option-selected-color: #5fffbf; | |||
$ant-select-option-selected-bg: #395257; | |||
$ant-divider-color: #3f4255; | |||
|
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.
Extra space
package.json
Outdated
"css-prefix-docs": "postcss --config build/postcss.config.js --replace \"assets/css/docs.min.css\" \"docs/**/*.css\"", | ||
"css-minify-docs": "cleancss --level 1 --source-map --source-map-inline-sources --output assets/css/docs.min.css assets/css/docs.min.css", | ||
"js": "npm-run-all js-lint* js-minify", | ||
"js-compile": "npm-run-all --parallel js-docs", | ||
"js-docs": "npm-run-all js-lint-docs js-minify-docs", | ||
"js-docs": "npm-run-all js-lint-docs js-minify-docs js-minify-argohub", |
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.
let's find a way to make js-minify-argohub
part of js-minify-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.
then it'll output this function into a common min.js file, and we need it separately.
package.json
Outdated
"js-lint-docs": "eslint assets/js/ docs/ sw.js", | ||
"js-minify": "npm-run-all --parallel js-minify-*", | ||
"js-minify-docs": "uglifyjs --mangle --comments \"/^!/\" --output assets/js/docs.min.js assets/js/vendor/anchor.min.js assets/js/vendor/clipboard.min.js assets/js/vendor/holder.min.js assets/js/vendor/jquery.smooth-scroll.min.js assets/js/vendor/jquery.cookie.min.js assets/js/vendor/jquery.navgoco.js \"assets/js/src/*.js\"", | ||
"js-minify-argohub": "uglifyjs assets/js/argohub-redirect.js --compress --mangle --output assets/js/argohub-redirect.min.js --comments \\\"/^!/\\\"", |
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 merge this command with js-minify-docs
?
"cross-env": "^5.1.3", | ||
"eslint": "^4.16.0", | ||
"eslint-plugin-compat": "^2.2.0", | ||
"fs-extra": "^11.3.0", |
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.
Do we need this package?
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, we use it in project
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
1 similar comment
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
"[CI] Staging environment is at http://staging-docs.codefresh.io.s3-website.us-east-1.amazonaws.com/update-node-version/docs/" |
No description provided.