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

chore: increase version to 0.8.2 and fix TD&TM dependency issues #765

Merged
merged 4 commits into from
May 27, 2022

Conversation

danielpeintner
Copy link
Member

set/fix TS definitions to

  • "wot-thing-description-types": "1.1.0-09-February-2022"
  • "wot-thing-model-types": "1.1.0-3-February-2022"

set/fix TS definitions to
- "wot-thing-description-types": "1.1.0-09-February-2022"
- "wot-thing-model-types": "1.1.0-3-February-2022"
@danielpeintner
Copy link
Member Author

Updating dependencies cause issues again for OPCUA
@erossignon can you please look into

Error: Cannot find enumeration with type Variant
at getEnumeration (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua-data-value\node_modules\node-opcua-factory\source\factories_enumerations.ts:97:15)
at figureOutSchema (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua-data-value\node_modules\node-opcua-factory\source\factories_structuredTypeSchema.ts:79:37)
at buildField (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua-data-value\node_modules\node-opcua-factory\source\factories_structuredTypeSchema.ts:97:20)
at Array.map (<anonymous>)
at new StructuredTypeSchema (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua-data-value\node_modules\node-opcua-factory\source\factories_structuredTypeSchema.ts:162:38)
at buildStructuredType (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua-data-value\node_modules\node-opcua-factory\source\factories_structuredTypeSchema.ts:327:12)
at Object.<anonymous> (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua-data-value\source\datavalue.ts:215:66)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua-data-value\source\index.ts:4:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua-types\source\_generated_opcua_types.ts:59:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua-types\source\index.ts:4:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua-common\source\index.ts:4:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\node-opcua\source\index.ts:23:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\packages\binding-opcua\test\client-test.ts:20:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Module.m._compile (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\ts-node\src\index.ts:1225:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Object.require.extensions.<computed> [as .ts] (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\ts-node\src\index.ts:1228:12)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.exports.requireOrImport (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\mocha\lib\nodejs\esm-utils.js:60:20)
at Object.exports.loadFilesAsync (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\mocha\lib\nodejs\esm-utils.js:103:20)
at singleRun (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\mocha\lib\cli\run-helpers.js:125:3)
at Object.exports.handler (C:\Projects\WoT\thingweb\thingweb.node-wot-danielpeintner\node_modules\mocha\lib\cli\run.js:374:5)

@erossignon
Copy link
Contributor

Updating dependencies cause issues again for OPCUA @erossignon can you please look into

I'm looking into this

@erossignon
Copy link
Contributor

@danielpeintner what is the version of node and and the version of npm that you are using to update the package-lock.json file ?

@erossignon
Copy link
Contributor

On my side I am using

node --version
v16.13.0

npm --version
8.7.0

I have deleted the package-lock.json file and run npm install again.

As a consequence the package-lock.log file looks different that the one which is produce by your toolset.

But also all test passes !

Can you describe the process you went through step by step to upgrade the package and the version of your tools ?

@danielpeintner
Copy link
Member Author

node v16.11.1
npm 8.3.0

@danielpeintner
Copy link
Member Author

danielpeintner commented May 20, 2022

I have deleted the package-lock.json file and run npm install again.

Did you remove all node_modules folders before running npm install.
I think if you don't prune all it picks again the ones you have already..

@erossignon
Copy link
Contributor

Good point,
Let me delete all the node_module folders at the root level and in any sub-packages folder as well and start again.

@erossignon
Copy link
Contributor

erossignon commented May 21, 2022

@danielpeintner , this prob puzzled me most of the day

I finally found the route cause the problem, npm install doesn't resolve properly some peerDependencies. peerDependencies are used in node-opcua-pubsub to specify the minimum version of some node-opcua that are required.

Let me describe the situation, imagine an nodejs module app that uses packages foo and bar.
foo is also using the bar package but it defines it in the peerDependency section instead of the "dependency" section in its package.json file, and specify the minimum bar version that is required.

app
   packages.json:
    {
       dependencies:  {
           "bar": "2.0.0",
           "foo": "0.1.0"
        }
    }
foo: {
    version: "0.1.0",
    packages.json:
     {
          peerDependencies: {
               bar: ">=1.0.0"
          }   
      }
}
  • the bar packages has 3 published versions [ "1.0.0", "2.0.0", "3.0.0"]

  • npm install produces

node_module:
     bar: (2.0.0) 
     foo: (0.1.0)
        node_module
             bar: (3.0.0)
  • the problem only occurs if a newer version of bar exists in the npm registry.)

The fix is to run npm dedupe after npm install and the problem disappears.

the layout becomes:

node_module:
     bar: (2.0.0) 
     foo: (0.1.0)
        node_module
             bar: (3.0.0)
             foo: (0.1.0) (dedupe)
  • note: using pnpm m install would produce the deduped layout directly. But I am not suggesting to use pnpm.

So the pattern to safely restore the package-lock.json file could be

$ npx rimraf node_modules package-lock.json # delete node_moudles
# optional:
$ npm exec --ws -- npx rimraf node_modules package-lock.json # delete also node_modules and local in all packages sub folder.
$ npm install 
$ npm dedupe

@danielpeintner
Copy link
Member Author

@erossignon thanks for your explanation. I updated the PR accordingly and also added some information in README.

@relu91
Copy link
Member

relu91 commented May 24, 2022

Is this process a one-time fix or do we need it to do it every time we install/update dependencies?

@danielpeintner
Copy link
Member Author

Is this process a one-time fix or do we need it to do it every time we install/update dependencies?

My understanding is that this is always necessary. But I let @erossignon confirm.
That's why I added this information to the README also (see a40f931)

@erossignon
Copy link
Contributor

yes, using npm dedupe will be a necessary small step to add, to fix version numbers inconsistencies.

@relu91
Copy link
Member

relu91 commented May 25, 2022

So even when I npm i @node-wot/binding-opcua? if so it needs to be declared also in OPC UA binding readme. I would say that it shouldn't be mandatory if I npm ci, is it?

@danielpeintner
Copy link
Member Author

I would say that it shouldn't be mandatory if I npm ci, is it?

npm ci works as usual.
It is needed in the phase of regenerating the package/lock file.

@danielpeintner
Copy link
Member Author

@relu91 are you okay with proceeding and merging this PR?

@relu91
Copy link
Member

relu91 commented May 27, 2022

yes, let's go.

@relu91 relu91 merged commit 8275284 into eclipse-thingweb:master May 27, 2022
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.

3 participants