Skip to content

Commit bda1fd3

Browse files
author
Oleksandr Dzhychko
authored
Merge pull request #829 from modelix/document-updateDependencies-task
chore(model-api-gen): add comment about "updateDependencies" task from NPM packages
2 parents 15c4440 + d5719bc commit bda1fd3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

model-api-gen-gradle-test/vue-integration/build.gradle.kts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ plugins {
55
alias(libs.plugins.node)
66
}
77

8+
/**
9+
* This task is needed because the listed packages have been rebuilt (locally or CI).
10+
* As a result, the verification hashes in package-lock.json are out of date.
11+
* Reinstalling them will update their hashes.
12+
* This issue only arises because we are using the packaged libraries.
13+
*
14+
* If you want to install a local package, it makes a difference whether you
15+
* (a) link the folder with the package.json and the built files,
16+
* (b) or pack it into a `tgz' using `npm pack'.
17+
*
18+
* We use packaged libraries (b) for the following reason:
19+
*
20+
* Packaged local packages (b) behave like packages pulled from NPM.
21+
* In case (a), Node.js doesn't behave like packages pulled by NPM.
22+
* Such packages will be loaded more than once if they are imported from different locations.
23+
* This is relevant when working with global declarations.
24+
*
25+
* This includes obvious things like global variables but also class declarations.
26+
* For example, loading the same class twice breaks `instanceof` checks
27+
* when objects are pass across JS module boundaries.
28+
* Another problem arises when the far-reaching `LanguageRegistry.INSTANCE` singleton is duplicated.
29+
*/
830
val updateDependencies = tasks.register<NpmTask>("updateDependencies") {
931
dependsOn(":typescript-generation:packJsPackage")
1032
args.set(

0 commit comments

Comments
 (0)