From f9555e684ccde880856de762cca93b348f078b09 Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Wed, 18 Dec 2024 15:43:00 -0500 Subject: [PATCH] Use Civet 0.9.2 to build faster --- build/esbuild.civet | 4 +--- package.json | 2 +- source/unplugin/README.md | 1 + yarn.lock | 32 ++++++-------------------------- 4 files changed, 9 insertions(+), 30 deletions(-) diff --git a/build/esbuild.civet b/build/esbuild.civet index 7234e980..49df1db0 100644 --- a/build/esbuild.civet +++ b/build/esbuild.civet @@ -1,8 +1,6 @@ try { require('node:module').enableCompileCache() } catch {} esbuild := require "esbuild" heraPlugin := require "@danielx/hera/esbuild-plugin" -// Need to use the packaged version because we may not have built our own yet -civetOldPlugin := require "../node_modules/@danielx/civet/dist/esbuild-plugin.js" civetUnplugin := require("../node_modules/@danielx/civet/dist/unplugin/esbuild.js").default civetPlugin := civetUnplugin ts: "civet" @@ -173,7 +171,7 @@ build({ plugins: [ resolveExtensions heraPlugin module: true - civetOldPlugin() // currently necessary for `alias` to work + civetPlugin ] }).catch -> process.exit 1 diff --git a/package.json b/package.json index 05cdf70a..e877c4c7 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "unplugin": "^2.1.0" }, "devDependencies": { - "@danielx/civet": "0.9.0", + "@danielx/civet": "0.9.2", "@danielx/hera": "^0.8.16", "@prettier/sync": "^0.5.2", "@types/assert": "^1.5.6", diff --git a/source/unplugin/README.md b/source/unplugin/README.md index 411d198b..c3d99bc5 100644 --- a/source/unplugin/README.md +++ b/source/unplugin/README.md @@ -213,6 +213,7 @@ interface PluginOptions { - `cache`: Cache compilation results based on file's mtime. Useful when bundling the same source files for both CommonJS and ESM, or for longer running processes like `watch` or `serve`. Default: `true`. + Be sure to re-use plugins instead of calling the plugin generator repeatedly. - `threads`: Use specified number of Node worker threads to compile Civet files faster. Default: `0` (don't use threads), or `CIVET_THREADS` environment variable if set. - `config`: Civet config filename to load, or `null` to avoid looking for the diff --git a/yarn.lock b/yarn.lock index a0a38dbb..7523b454 100644 --- a/yarn.lock +++ b/yarn.lock @@ -150,14 +150,14 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@danielx/civet@0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@danielx/civet/-/civet-0.9.0.tgz#ab78108c83ecd8fdfc804048fb9ce7341303e2d5" - integrity sha512-DjeJ2gAXPK2g2JlVPAspQkp1AWftofl6WgxDb10rYVJN3BTf7E4es4rHxP56lEengZMwAtxUFEbadjQIZhiiSg== +"@danielx/civet@0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@danielx/civet/-/civet-0.9.2.tgz#05be7f8e1b77acdea86d91819669076b0447a020" + integrity sha512-8cooX7VfctmLuf6GVMtZ/wW+yro8NXRR0AaJobXNA4w+AnUMx1LwlZ7ObQauTACxczS2xZvCNZo3Jc5fncXAWg== dependencies: "@cspotcode/source-map-support" "^0.8.1" "@typescript/vfs" "^1.6.0" - unplugin "^1.12.2" + unplugin "^2.1.0" "@danielx/hera@^0.8.16": version "0.8.16" @@ -669,11 +669,6 @@ acorn@^8.11.0, acorn@^8.14.0, acorn@^8.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== -acorn@^8.12.1: - version "8.12.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" - integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== - acorn@^8.8.2: version "8.10.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" @@ -812,7 +807,7 @@ chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chokidar@^3.5.3, chokidar@^3.6.0: +chokidar@^3.5.3: version "3.6.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== @@ -1558,16 +1553,6 @@ undici-types@~6.20.0: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== -unplugin@^1.12.2: - version "1.12.2" - resolved "https://registry.yarnpkg.com/unplugin/-/unplugin-1.12.2.tgz#cc85aef010614394898caccf5f17002af8a4cd6f" - integrity sha512-bEqQxeC7rxtxPZ3M5V4Djcc4lQqKPgGe3mAWZvxcSmX5jhGxll19NliaRzQSQPrk4xJZSGniK3puLWpRuZN7VQ== - dependencies: - acorn "^8.12.1" - chokidar "^3.6.0" - webpack-sources "^3.2.3" - webpack-virtual-modules "^0.6.2" - unplugin@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/unplugin/-/unplugin-2.1.0.tgz#c093c34bf52812131125b67d0724bd57685c830a" @@ -1674,11 +1659,6 @@ vue@^3.2.45, vue@^3.3.4: "@vue/server-renderer" "3.3.4" "@vue/shared" "3.3.4" -webpack-sources@^3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" - integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== - webpack-virtual-modules@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz#057faa9065c8acf48f24cb57ac0e77739ab9a7e8"