diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-11-21 15:41:28 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-11-21 16:06:12 +0100 |
commit | a530fe054944ca28bb49985c4334de20bca9c24c (patch) | |
tree | 4fea027fa584524a5c2b1a760059a0a2f731ca01 /gradle | |
parent | chore(web): remove eslint-plugin-sonarjs (diff) | |
download | refinery-a530fe054944ca28bb49985c4334de20bca9c24c.tar.gz refinery-a530fe054944ca28bb49985c4334de20bca9c24c.tar.zst refinery-a530fe054944ca28bb49985c4334de20bca9c24c.zip |
build: move to yarn workspaces
The root project (worktree) must have a valid package.json,
.yarnrc.yaml, and have the gradle precompiled script plugin
refinery-frontend-worktree applied to it.
All frontend modules (workspaces) must have a valid package.json, be
referenced in the worktree project.json, and be a valid gradle
subproject with the gradle precompiled script plugin
refinery-frontend-workspace applied to it.
To reduce unnecessary downloads, we do the following workarounds:
* The node version is pinned in gradle.properties and the installed node
version is stored in .node/frontend.properties. A new node version is
only downloaded if it differs from the installed one (or none is
installed). This improves on the default gradle behavior, which would
download a new node version if the classpath of the installNode task
was changed.
* The yarn classic version is pinned in gradle.properties and the
installed yarn classic version is stored in .node/frontend.properties.
This improves on the default gradle behavior, which would reinstall
the yarn npm package at every build.
* We disable the enableYarnBerry task, since a yarn berry version is
already committed into the repository at .yarn/versions as it is
recommended in http://yarnpkg.com/getting-started/qa/
* We use yarn set version --only-if-needed in the installYarn task.
* The installFrontend task takes package.json and yarn.lock as inputs
and produces .pnp.cjs and .pnp.loader.mjs as outputs. Whether this
task is up-to-date can be checked by gradle quickly, since it doesn't
have to traverse the node_module folder due to pnp resoltion:
https://yarnpkg.com/features/pnp/
All workspaces have the installNode, installYarnGlobally, installYarn
and installFrontend tasks disabled. However, these tasks depend on the
task with the same name in the worktree project, so installation is
still triggered globally. Moreover, the installFrontend task in the
worktree has the package.json of the workspaces as inputs, so
reinstallation is triggered when the workspace package.json changes.
Diffstat (limited to 'gradle')
-rw-r--r-- | gradle/libs.versions.toml | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 10b3bacb..60241c3b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml | |||
@@ -11,6 +11,7 @@ xtext = "2.26.0.M2" | |||
11 | ecore = { group = "org.eclipse.emf", name = "org.eclipse.emf.ecore", version = "2.25.0" } | 11 | ecore = { group = "org.eclipse.emf", name = "org.eclipse.emf.ecore", version = "2.25.0" } |
12 | ecore-xmi = { group = "org.eclipse.emf", name = "org.eclipse.emf.ecore.xmi", version = "2.16.0" } | 12 | ecore-xmi = { group = "org.eclipse.emf", name = "org.eclipse.emf.ecore.xmi", version = "2.16.0" } |
13 | ecore-codegen = { group = "org.eclipse.emf", name = "org.eclipse.emf.codegen.ecore", version = "2.27.0" } | 13 | ecore-codegen = { group = "org.eclipse.emf", name = "org.eclipse.emf.codegen.ecore", version = "2.27.0" } |
14 | frontendGradle = { group = "org.siouan", name = "frontend-gradle-plugin-jdk11", version = "6.0.0" } | ||
14 | hamcrest = { group = "org.hamcrest", name = "hamcrest", version = "2.2" } | 15 | hamcrest = { group = "org.hamcrest", name = "hamcrest", version = "2.2" } |
15 | jetty-server = { group = "org.eclipse.jetty", name = "jetty-server", version.ref = "jetty" } | 16 | jetty-server = { group = "org.eclipse.jetty", name = "jetty-server", version.ref = "jetty" } |
16 | jetty-servlet = { group = "org.eclipse.jetty", name = "jetty-servlet", version.ref = "jetty" } | 17 | jetty-servlet = { group = "org.eclipse.jetty", name = "jetty-servlet", version.ref = "jetty" } |
@@ -42,6 +43,3 @@ xtext-testing = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.testing | |||
42 | xtext-web = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.web", version.ref = "xtext" } | 43 | xtext-web = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.web", version.ref = "xtext" } |
43 | xtext-xbase = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.xbase", version.ref = "xtext" } | 44 | xtext-xbase = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.xbase", version.ref = "xtext" } |
44 | xtext-xbase-ide = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.xbase.ide", version.ref = "xtext" } | 45 | xtext-xbase-ide = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.xbase.ide", version.ref = "xtext" } |
45 | |||
46 | [plugins] | ||
47 | frontend = { id = "org.siouan.frontend-jdk11", version = "6.0.0" } | ||