Skip to content

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

Merged
merged 14 commits into from
Jun 30, 2025
Merged

Conversation

alinashklyar
Copy link
Contributor

No description provided.

@codefresh-git-integration
Copy link

1 similar comment
@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

1 similar comment
@codefresh-git-integration
Copy link

@@ -1,3 +1,6 @@
/* eslint-disable no-implicit-globals, strict */
/* global SITE_BASE_URL, SITE_GITOPS_COLLECTION, SITE_IS_GITOPS_COLLECTION */

Copy link
Contributor Author

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

@codefresh-git-integration
Copy link

@import "../../node_modules/bootstrap/scss/variables";

//@import "../../scss/mixins";
@import "../../node_modules/bootstrap/scss/mixins";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@import is deprecated

@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

.babelrc.js Outdated
@@ -1,16 +1,13 @@
module.exports = {
presets: [
[
'@babel/env',
'@babel/preset-env',
Copy link
Contributor

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.

Copy link
Contributor Author

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


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`)
Copy link
Contributor

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.

Copy link
Contributor Author

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

@@ -64,6 +72,7 @@ function toggleSegmentDropdown() {
select.classList.toggle('open')
}

// eslint-disable-next-line no-unused-vars
Copy link
Contributor

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?

Copy link
Contributor Author

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

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(
Copy link
Contributor

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.

Copy link
Contributor Author

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

@@ -149,6 +134,39 @@ async function selectSegmentOption(option, selectedValue) {
}
}

// eslint-disable-next-line no-unused-vars
Copy link
Contributor

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?

@@ -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")}
Copy link
Contributor

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

@@ -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;

Copy link
Contributor

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",
Copy link
Contributor

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

Copy link
Contributor Author

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 \\\"/^!/\\\"",
Copy link
Contributor

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",
Copy link
Contributor

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?

Copy link
Contributor Author

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

@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

1 similar comment
@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

@alinashklyar alinashklyar merged commit da853d8 into master Jun 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants