Skip to content
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

[maven,typescript] (#332, #462, #463) Update dependencies to latest package versions #582

Open
wants to merge 36 commits into
base: main
Choose a base branch
from

Conversation

deyan-r
Copy link

@deyan-r deyan-r commented Dec 30, 2024

Description

Typescript projects were updated to require Node.js 20+(node>=20.18.1, npm>=10.8.2)
All dependencies were updated to the latest versions.
Where needed, the code was updated to be compatible with changes in components interfaces.
Such alignment includes, but not limited to:

  • all: update dependencies to latest versions and resolve minor issues
  • polyglotpkg: fs-extra and globby were replaced by fs
  • vropkg: updated according new uuid and unzipper api; minor differences in expected files
  • vrotest: fs-extra was replaced by fs
  • vrotsc: few changes in expected js code generated by the latest version of tsc

Polyglot archetype to set proper runtime values in polyglot.json for sample vro templates.
A few bugs encountered were fixed.

Checklist

  • I have added relevant error handling and logging messages to help troubleshooting
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation, relevant usage information (if applicable)
  • I have updated the PR title with affected component, related issue number and a short summary of the changes introduced
  • I have added labels for implementation kind (kind/) and version type (version/)
  • I have tested against live environment, if applicable
  • I have synced any structure and/or content vRA-NG improvements with vra-ng and ts-vra-ng archetypes (if applicable)
  • I have my changes rebased and squashed to the minimal number of relevant commits. Notice: don't squash all commits
  • I have added a descriptive commit message with a short title, including a Fixed #XXX - or Closed #XXX - prefix to auto-close the issue

Testing

Testing included three steps:

  1. Build components and entire BTVA (unit and integration tests passed)
  2. Archetype lifecycle testing: create, build, push, pull
  3. Build and push existing vra/vro projects

Release Notes

Update typescript projects to node.js 20+ and latest versions of dependencies

Related issues and PRs

#463
#462
#332 (duplicated by #464)

pboychev-bcom and others added 30 commits November 7, 2024 16:26
Done for component docs/archive/doc. Tested with Node.js version 22.11.0.
Done for component typescript/vro-scripting-api. Tested with Node.js version 22.11.0.
* chore: Updated dependency versions of adm-zip and @types/adm-zip

* chore: Updated dependency versions of @types/uuid / uuid.

* chore: Updated dependency versions of command-line-args / @types/command-line-args.

* chore: Updated dependency version of ts-node
…nv" and "typescript/polyglotpkg" (#3)

* chore: Updated dependency versions of adm-zip and @types/adm-zip

* chore: Updated dependency versions of @types/uuid / uuid.

* chore: Updated dependency versions of command-line-args / @types/command-line-args.

* chore: Updated dependency version of ts-node

* chore: Updated dependencies for component "typescript/npmconv".
All dependencies that could be updated without too much effort were updated.
* chore: Ran npm update for vrotsc, updated package lock file.

* chore: Updated "uuid" dependency for "vrotsc".

* chore: Updated "js-yaml" dependency for "vrotsc".
Also updated the "@types/js-yaml" definitions.

* chore: Updated "minimist" dependency for "vrotsc".
Also updated the "@types/minimist" definitions.

* chore: Updated "xmlbuilder" dependency for "vrotsc".

* chore: Updated "xmldoc" dependency for "vrotsc".
Also updated the "@types/xmldoc" definitions.

* chore: Updated "ansi-colors" dependency for "vrotsc".

* chore: Updated "merge2" dependency for "vrotsc".

* chore: Updated "rollup" dependency and plugins for "vrotsc".

* chore: Updated "ts-node" dependency for "vrotsc".

* chore: Updated gulp + sourcemap dependencies for "vrotsc".
Updated to latest versions of "which", "npm", "fs-extra" and "glob". Code changes related to supporting the latest library APIs.
* chore: Updated Node.js and npm version requirements for "typescript/polyglotpkg" component.

* chore: Updated dependencies for "typescript/polyglotpkg" component.
Updated "which" / "@types/which" to latest, implemented code changes accordingly.

* refactor: Removed "fs-extra" in favor of using Node.js API for "typescript/polyglotpkg" component.

* refactor: Recursive copy exported to a filesystem utils class. Unit tests added for it.

* refactor: Project build bootstrapping changed; replacing "globby" with capability in the project; updating dependencies"

* chore: Removed "globby" as dependency.

* refactor: Polyglot component not using globby and fs-extra libs any more. All dependencies updated to latest. Node.js 20 LTS support added.

* refactor: Using native Node.js cpSync function.
…ot" component. (#7)

* chore: Updated Node.js and npm version requirements for "typescript/polyglotpkg" component.

* chore: Updated dependencies for "typescript/polyglotpkg" component.
Updated "which" / "@types/which" to latest, implemented code changes accordingly.

* refactor: Removed "fs-extra" in favor of using Node.js API for "typescript/polyglotpkg" component.

* refactor: Recursive copy exported to a filesystem utils class. Unit tests added for it.

* refactor: Project build bootstrapping changed; replacing "globby" with capability in the project; updating dependencies"

* chore: Removed "globby" as dependency.

* refactor: Polyglot component not using globby and fs-extra libs any more. All dependencies updated to latest. Node.js 20 LTS support added.

* refactor: Using native Node.js cpSync function.
The following packages were updated to the latest versions available:
- @rollup/plugin-commonjs
- rollup
- ts-node
- typescript
Signed-off-by: Plamen Boychev <[email protected]>
The following packages were updated to the latest versions available:
- nyc
- rimraf
- ansi-colors
- @types/ansi-colors
- jszip
- @types/jszip
- @types/jasmine
- jasmine
- browserslist
Signed-off-by: Plamen Boychev <[email protected]>
The following packages were updated to the latest versions available:
- @types/minimist
- minimist
- source-map
- @types/gulp
Signed-off-by: Plamen Boychev <[email protected]>
Using the built-in "fs" Node.js module capabilities instead.
Signed-off-by: Plamen Boychev <[email protected]>
Updates apply to npmconv, polyglotpkg and vropkg.
Signed-off-by: Plamen Boychev <[email protected]>
@deyan-r deyan-r requested a review from a team as a code owner December 30, 2024 08:52
@vmwclabot
Copy link
Member

@deyan-r, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@deyan-r, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@github-actions github-actions bot added kind/dependencies Pull requests that update a dependency file kind/feature New Feature to the project labels Dec 30, 2024
@VenelinBakalov
Copy link
Collaborator

Nice that's quite some effort put in this one! I will try to get help with reviewing this PR soon. We will for sure need a Release.md entry with the changes you described in the PR description and also a suggested Upgrade procedure because of the major change of the node version. Let me first discuss internally how to handle that and then we can update the PR.

@VenelinBakalov VenelinBakalov changed the title Feature/463 update dependencies to latest package versions [maven,typescript] (#463) Update dependencies to latest package versions Jan 3, 2025
@VenelinBakalov VenelinBakalov changed the title [maven,typescript] (#463) Update dependencies to latest package versions [maven,typescript] (#332, #462, #463) Update dependencies to latest package versions Jan 3, 2025
@VenelinBakalov VenelinBakalov added area/dependencies Relates to updates to dependency file(s) area/build Relates to the build process lang/javascript Releated to Javascript code lang/typescript Related to typescript code area/vro-scripting-api Relates to the vro-scripting-api module area/vropkg Relates to `vropkg` module area/vrotsc Relates to `vrotsc` module version/minor Introduces a non-breaking feature or change area/polyglotpkg Relates to polyglotpkg module or archetype area/tests Relates to tests and code coverage area/maven Relates to maven changes and removed dco-required labels Jan 3, 2025
@Michaelpalacce
Copy link
Collaborator

@deyan-r great job on the PR, a lot of effort was put in it I can tell.

@Michaelpalacce
Copy link
Collaborator

Are there any obstacles to using nodejs22 instead of node 20? I would rather set that as the official goal as 20 is almost in maintenance.

ref: https://nodejs.org/en/about/previous-releases

@Michaelpalacce
Copy link
Collaborator

Checkout .github/workflows/build.yaml

        node: ["16.20.2"]
        node_vmware_samples: ["14.17.1"]

Should be changed to:

        node: ["22.12.0"]
        node_vmware_samples: ["22.12.0"]

@Michaelpalacce
Copy link
Collaborator

Generally we used tabs instead of spaces, I recommend you respect the editorconfig in the project so we don't have to see giant changelogs. It'd be great if you can fix this

@Michaelpalacce
Copy link
Collaborator

From all the de async-ing, I wonder if the speed was impacted negatively in any way

subPath?: string;
absolute?: boolean;
}
export function findFiles(patterns: RegExp[] | string[], options: FindFilesOptions = {}): string[] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is to replace globby I suppose? Can we add documentation here how to use this and we are good

* This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file.
* #L%
*/
import { copyFileSync, mkdirSync, readdirSync, realpathSync, statSync } from "fs";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unused imports

@@ -77,7 +77,7 @@ export const xmlToAction = (file: string, bundlePath: string, name: string, comm
};
params.push(param);
} else if (element.type == "element" && element.name == "script") {
inline = getScriptInline(file, element, comment, this.lazy);
inline = getScriptInline(file, element, comment, false); // @TODO: check if lazy parameter is still relevant
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not. Logic related to it can be removed

@@ -17,6 +17,7 @@ import * as FileSystem from "fs-extra";
import * as XmlBuilder from "xmlbuilder2";
import * as unzipper from "unzipper";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unused imports

}
xInfo.ele("entry").att("key", "categoryPath").text(pathKey)
if (element.type == t.VroElementType.ResourceElement) {
xInfo.ele("entry").att("key", "mimetype").text(element.attributes["mimetype"]);
if (element.type == t.VroElementType.ResourceElement && element.attributes["mimetype"]) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

In XML, an empty attribute (e.g., attribute="") is not the same as a missing attribute. An empty attribute explicitly indicates that the attribute exists but has no value, while a missing attribute indicates that the attribute does not exist at all. Not sure if this is important just wanted to note it

Copy link
Collaborator

Choose a reason for hiding this comment

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

Will leave a //@note with this

"declaration": false,
"declarationMap": false,
"strict": false,
"newLine": "lf",
Copy link
Collaborator

Choose a reason for hiding this comment

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

align a little bit

@@ -19,41 +19,35 @@
"clean": "gulp clean"
},
"engines": {
"node": ">=16.15.1",
"npm": ">=6.14.0"
"node": ">=20.18.1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we do an upper limit too?

@@ -92,3 +92,15 @@ export async function withWorkingDir(dir: string, action: () => Promise<void>):
}
}
}

type CopyFilter = (fileName: string) => boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not used anywhere?

@Michaelpalacce
Copy link
Collaborator

Also, change the health.sh to be min/max Nodejs 22

MIN_NODE_VERSION="22"
MAX_NODE_VERSION="22"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Relates to the build process area/dependencies Relates to updates to dependency file(s) area/maven Relates to maven changes area/polyglotpkg Relates to polyglotpkg module or archetype area/tests Relates to tests and code coverage area/vro-scripting-api Relates to the vro-scripting-api module area/vropkg Relates to `vropkg` module area/vrotsc Relates to `vrotsc` module kind/dependencies Pull requests that update a dependency file kind/feature New Feature to the project lang/javascript Releated to Javascript code lang/typescript Related to typescript code version/minor Introduces a non-breaking feature or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants