From b1e2c8fd5cb5dfa46bc440a12eafaf56cd844b1c Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Mon, 24 Nov 2025 20:54:57 +0100 Subject: Docs --- node_modules/tailwindcss/scripts/swap-engines.js | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 node_modules/tailwindcss/scripts/swap-engines.js (limited to 'node_modules/tailwindcss/scripts/swap-engines.js') 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.' +) -- cgit v1.2.3