Using local copy of @dojo/widgets

Hi,

I would really like to contribute to Dojo2+, but I’m still struggling with getting a local copy of a repo (@dojo/widgets in my case) to be used in my application.

Tried “grunt dist” and “grunt dev” in the repo and got warnings, which were treated as errors (using --force option this could be solved).

No chance to get the local copy installed in my project.

npm install …/path/to/my/copy/

gives errors:

npm install e:/Work/autstat/dojo2/widgets
npm WARN heurigen@1.0.0 No repository field.
npm WARN heurigen@1.0.0 No license field.

npm ERR! path e:\Work\oinkoink\rkassa\web\heurigen.test\node_modules.staging@dojo\widgets-e1276e49\node_modules@csstools\convert-colors
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename ‘e:\Work\oinkoink\rkassa\web\heurigen.test\node_modules.staging@dojo\widgets-e1276e49\node_modules@csstools\convert-colors’ -> ‘e:\Work\oinkoink\rkassa\web\heurigen.test\node_modules.staging@csstools\convert-colors-dd1077c7’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\thomas\AppData\Roaming\npm-cache_logs\2019-06-03T17_39_24_259Z-debug.log

Any ideas?

Thanks,
Thomas

You probably want to use npm link instead.

Thanks, will try that.

Nevertheless, my priority is getting npm install working. This is so basic a function that I do not think any problem is to be ignored.

Thanks,
Thomas

Hi Thomas,

It’s great to hear that you want to contribute to Dojo!

To use a local copy of a dojo dependency like @dojo/widgets needs the package to be packaged in the same shape as when it is published to npm. To do this you will need to perform a dry run release that creates a tar ball of the package.

Currently @dojo/widgets still uses the grunt commands for these operations, so you would need to run (tweaking the versions as desired):

grunt release --release-version="5.0.4" --next-version="5.0.5-pre" --dry-run --skip-checks --initial

This will create an installable tarball in the projects dist directory that can be copied to your local package and installed.

npm install file://./dojo-widgets-5.0.4.tgz

Hope this helps!

Thanks, Dylan, this works fine for me. Got it running, can use the modified widgets.

Unfortunately I’m farer away from contributing to Dojo2 than before. I’d like to test the modifications before filing a pull request, but I cannot find any hints on how to do this. How can I run the tests that are run when analyzing a pull request myself?

I cannot even run “grunt dev” without --force:

e:\Work\autstat\dojo2\widgets>grunt dev
Running “clean:typings” (clean) task

0 paths cleaned.

Running “typings:dev” (typings) task

Running “tslint:src” (tslint) task

187 files lint free.

Running “clean:dev” (clean) task

1 path cleaned.

Running “tcm” task

Running “copy:staticDefinitionFiles-dev” (copy) task
Copied 48 files

Running “dojo-ts:dev” (dojo-ts) task

Running “ts:dev” (ts) task
Compiling…
Using tsc v2.6.2
node_modules/@dojo/shim/Symbol.d.ts(3,9): error TS2687: All declarations of ‘observable’ must have identical modifiers.

1 non-emit-preventing type warning
Error: tsc return code: 2
Warning: Task “ts:dev” failed. Use --force to continue.

Aborted due to warnings.

Hi Thomas,

A few of us on the team have tried to reproduce this error but have not been able to reproduce this locally. Perhaps you could pop onto Discord and chat with the team in real-time so we can help track this down?

Thanks,
-Dylan