summaryrefslogtreecommitdiff
path: root/node_modules/tailwindcss/scripts/swap-engines.js
diff options
context:
space:
mode:
authorPhilipp Tanlak <philipp.tanlak@gmail.com>2025-11-24 20:54:57 +0100
committerPhilipp Tanlak <philipp.tanlak@gmail.com>2025-11-24 20:57:48 +0100
commitb1e2c8fd5cb5dfa46bc440a12eafaf56cd844b1c (patch)
tree49d360fd6cbc6a2754efe93524ac47ff0fbe0f7d /node_modules/tailwindcss/scripts/swap-engines.js
Docs
Diffstat (limited to 'node_modules/tailwindcss/scripts/swap-engines.js')
-rw-r--r--node_modules/tailwindcss/scripts/swap-engines.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/node_modules/tailwindcss/scripts/swap-engines.js b/node_modules/tailwindcss/scripts/swap-engines.js
new file mode 100644
index 0000000..ef8308a
--- /dev/null
+++ b/node_modules/tailwindcss/scripts/swap-engines.js
@@ -0,0 +1,40 @@
+let fs = require('fs')
+let path = require('path')
+
+let engines = {
+ stable: {
+ files: [
+ path.resolve(__dirname, '..', 'package.stable.json'),
+ path.resolve(__dirname, '..', 'package-lock.stable.json'),
+ ],
+ },
+ oxide: {
+ files: [
+ path.resolve(__dirname, '..', 'package.oxide.json'),
+ path.resolve(__dirname, '..', 'package-lock.oxide.json'),
+ ],
+ },
+}
+
+// Find out what the current engine is that we are using:
+let [otherEngine, info] = Object.entries(engines).find(([, info]) =>
+ info.files.every((file) => fs.existsSync(file))
+)
+let currentEngine = otherEngine === 'oxide' ? 'stable' : 'oxide'
+
+console.log(`Current engine: \`${currentEngine}\`, swapping to \`${otherEngine}\``)
+
+// Swap the engines
+for (let file of info.files) {
+ fs.renameSync(
+ file.replace(`.${otherEngine}`, ''),
+ file.replace(`.${otherEngine}`, `.${currentEngine}`)
+ )
+}
+for (let file of engines[otherEngine].files) {
+ fs.renameSync(file, file.replace(`.${otherEngine}`, ''))
+}
+
+console.log(
+ 'Engines have been swapped. Make sure to run `npm install` to update your dependencies.'
+)