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

Upgrade ts-node dependency #1661

Merged

Conversation

SanjalKatiyar
Copy link
Collaborator

@openshift-ci openshift-ci bot added the approved label Nov 7, 2024
@@ -27,7 +27,7 @@
"build-mco": "NODE_ENV=production PLUGIN=mco I8N_NS=plugin__odf-multicluster-console yarn build:plugin",
"build-client": "NODE_ENV=production PLUGIN=client I8N_NS=plugin__odf-client-console yarn build:plugin",
"build-dev": "NODE_ENV=development PLUGIN=odf I8N_NS=plugin__odf-console yarn build:plugin",
"server:plugin": "yarn build:generate && I8N_NS=${I8N_NS} yarn ts-node --stack-size=65500 ./node_modules/.bin/webpack serve -c ./webpack.config.ts --progress",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

--stack-size not recognised by newer version of ts-node...
also I didn't face any issue after removing it, so didn't add any alternative...

@@ -38,7 +38,7 @@
"dev-client": "PLUGIN=client I8N_NS=plugin__odf-client-console yarn server:plugin",
"serve-local-build": "./http-server.sh ./plugins/odf/dist",
"serve-local-build-mco": "./http-server.sh ./plugins/mco/dist",
"ts-node": "ts-node -O '{\"module\":\"commonjs\"}' -I '/node_modules/(?!(@odf)/)/'",
"ts-node": "ts-node --transpile-only -O '{\"module\":\"commonjs\"}' -I '/node_modules/(?!(@odf)/)/'",
Copy link
Collaborator Author

@SanjalKatiyar SanjalKatiyar Nov 7, 2024

Choose a reason for hiding this comment

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

Looks like newer version of ts-node is more strict, even though we are using -I flag it still checks ./node_modules/.bin/webpack (check yarn build:plugin) and reports error:

TSError: ⨯ Unable to compile TypeScript:
node_modules/webpack/node_modules/graceful-fs/graceful-fs.js:34:3 - error TS2322: Type '(msg: string, ...param: any[]) => void' is not assignable to type '() => void'.
  Target signature provides too few arguments. Expected 1 or more, but got 0.

34   debug = util.debuglog('gfs4')
     ~~~~~
node_modules/webpack/node_modules/graceful-fs/graceful-fs.js:52:3 - error TS2741: Property '__promisify__' is missing in type '(fd: any, cb: any) => any' but required in type 'typeof close'.

52   fs.close = (function (fs$close) {
     ~~~~~~~~

  node_modules/@types/node/fs.d.ts:1251:18
    1251         function __promisify__(fd: number): Promise<void>;
                          ~~~~~~~~~~~~~
    '__promisify__' is declared here.
node_modules/webpack/node_modules/graceful-fs/graceful-fs.js:72:25 - error TS6133: 'fd' is declared but its value is never read.

72     function closeSync (fd) {
                           ~~
node_modules/webpack/node_modules/graceful-fs/graceful-fs.js:86:13 - error TS2554: Expected 0 arguments, but got 1.

86       debug(fs[gracefulQueue])

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

only way which worked is to use --transpile-only... which I think is relatively okay as editor (IDE) is still configured with typescript support and this flag only affects selective files only...

@alfonsomthd
Copy link
Collaborator

/lgtm

Copy link
Contributor

openshift-ci bot commented Nov 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alfonsomthd, SanjalKatiyar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [SanjalKatiyar,alfonsomthd]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit fd1ddd4 into red-hat-storage:master Nov 7, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants