From 3bfd6c6979a16e7a22b8bea1cb30529b1a0fb3c2 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Tue, 3 Jan 2023 11:38:57 +0100 Subject: [PATCH] chore: use Turborepo to build Why? - ordering: build dependencies before dependents - cache: don't rebuild if no changes in files or dependencies - possibility to restrict to specific scopes Changes: - `yarn build` now only build `xo-server` and `xo-web` (and dependencies) - `yarn build:xo-lite` build `@xen-orchestra/lite\ (and dependencies) --- .gitignore | 1 + package.json | 4 +++- turbo.json | 8 ++++++++ yarn.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 turbo.json diff --git a/.gitignore b/.gitignore index 3f0c0acd62d..ffb53b2dff7 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ yarn-error.log.* # code coverage .nyc_output/ coverage/ +.turbo/ diff --git a/package.json b/package.json index 239518572c0..d6e0b940514 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "promise-toolbox": "^0.21.0", "semver": "^7.3.6", "sorted-object": "^2.0.1", + "turbo": "^1.6.3", "vue": "^2.7.14", "vuepress": "^1.4.1" }, @@ -81,7 +82,8 @@ }, "private": true, "scripts": { - "build": "scripts/run-script.js --parallel --concurrency 2 build", + "build": "turbo run build --scope xo-server --scope xo-web", + "build:xo-lite": "turbo run build --scope @xen-orchestra/lite", "ci": "yarn && yarn build && yarn test-lint && yarn test-integration", "clean": "scripts/run-script.js --parallel clean", "dev": "scripts/run-script.js --parallel --concurrency 0 --verbose dev", diff --git a/turbo.json b/turbo.json new file mode 100644 index 00000000000..d61008d8d71 --- /dev/null +++ b/turbo.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://turborepo.org/schema.json", + "pipeline": { + "build": { + "dependsOn": ["^build"] + } + } +} diff --git a/yarn.lock b/yarn.lock index 42cb10da974..07d3395448b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18869,6 +18869,48 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" +turbo-darwin-64@1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-1.6.3.tgz#fad7e078784b0fafc0b1f75ce9378828918595f5" + integrity sha512-QmDIX0Yh1wYQl0bUS0gGWwNxpJwrzZU2GIAYt3aOKoirWA2ecnyb3R6ludcS1znfNV2MfunP+l8E3ncxUHwtjA== + +turbo-darwin-arm64@1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-1.6.3.tgz#f0a32cae39e3fcd3da5e3129a94c18bb2e3ed6aa" + integrity sha512-75DXhFpwE7CinBbtxTxH08EcWrxYSPFow3NaeFwsG8aymkWXF+U2aukYHJA6I12n9/dGqf7yRXzkF0S/9UtdyQ== + +turbo-linux-64@1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-1.6.3.tgz#8ddc6ac55ef84641182fe5ff50647f1b355826b0" + integrity sha512-O9uc6J0yoRPWdPg9THRQi69K6E2iZ98cRHNvus05lZbcPzZTxJYkYGb5iagCmCW/pq6fL4T4oLWAd6evg2LGQA== + +turbo-linux-arm64@1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-1.6.3.tgz#846c1dc84d8dc741651906613c16acccba30428c" + integrity sha512-dCy667qqEtZIhulsRTe8hhWQNCJO0i20uHXv7KjLHuFZGCeMbWxB8rsneRoY+blf8+QNqGuXQJxak7ayjHLxiA== + +turbo-windows-64@1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.6.3.tgz#89ac819fa76ad31d12fbfdeb3045bcebd0d308eb" + integrity sha512-lKRqwL3mrVF09b9KySSaOwetehmGknV9EcQTF7d2dxngGYYX1WXoQLjFP9YYH8ZV07oPm+RUOAKSCQuDuMNhiA== + +turbo-windows-arm64@1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/turbo-windows-arm64/-/turbo-windows-arm64-1.6.3.tgz#977607c9a51f0b76076c8b158bafce06ce813070" + integrity sha512-BXY1sDPEA1DgPwuENvDCD8B7Hb0toscjus941WpL8CVd10hg9pk/MWn9CNgwDO5Q9ks0mw+liDv2EMnleEjeNA== + +turbo@^1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.6.3.tgz#ec26cc8907c38a9fd6eb072fb10dad254733543e" + integrity sha512-FtfhJLmEEtHveGxW4Ye/QuY85AnZ2ZNVgkTBswoap7UMHB1+oI4diHPNyqrQLG4K1UFtCkjOlVoLsllUh/9QRw== + optionalDependencies: + turbo-darwin-64 "1.6.3" + turbo-darwin-arm64 "1.6.3" + turbo-linux-64 "1.6.3" + turbo-linux-arm64 "1.6.3" + turbo-windows-64 "1.6.3" + turbo-windows-arm64 "1.6.3" + tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"