drop oxide api shim

This commit is contained in:
Robin Malfait 2023-02-08 17:34:33 +01:00
parent 0bf3a7dda6
commit add16364b4
No known key found for this signature in database
GPG Key ID: 92F53D68B9041AFE
4 changed files with 1 additions and 31 deletions

View File

@ -1,21 +0,0 @@
let log = require('../lib/util/log').default
// This should be a temporary file.
//
// Right now we require `@tailwindcss/oxide` as one of the packages in package.json. This contains
// all the necessary Rust bindings. However, we won't ship those bindings by default yet, and
// therefore you need to install the explicit oxide-insiders version where the Rust bindings are
// available.
//
// To ensure that this doesn't break existing builds of the insiders release, we will use this shim
// to implement all the APIs and show a warning in case you are trying to run `OXIDE=1 npx
// tailwindcs ...` without having installed the oxide-insiders version.
module.exports.parseCandidateStringsFromFiles = function parseCandidateStringsFromFiles(
_changedContent
) {
log.warn('oxide-required', [
'It looks like you are trying to run Tailwind CSS with the OXIDE=1 environment variable.',
'This version does not have the necessary Rust bindings, so please install the `tailwindcss@insiders-oxide` version instead.',
])
return []
}

View File

@ -1,5 +0,0 @@
{
"name": "@tailwindcss/oxide-shim",
"main": "./index.js",
"license": "MIT"
}

View File

@ -41,7 +41,6 @@
"stubs/*.stub.js",
"nesting/*",
"types/**/*",
"oxide-node-api-shim",
"*.d.ts",
"*.css",
"*.js"
@ -71,7 +70,6 @@
"postcss": "^8.0.9"
},
"dependencies": {
"@tailwindcss/oxide": "file:./oxide-node-api-shim",
"arg": "^5.0.2",
"chokidar": "^3.5.3",
"color-name": "^1.1.4",

View File

@ -6,8 +6,6 @@ import log from '../util/log'
import cloneNodes from '../util/cloneNodes'
import { defaultExtractor } from './defaultExtractor'
import oxide from '@tailwindcss/oxide'
let env = sharedState.env
const builtInExtractors = {
@ -134,7 +132,7 @@ export default function expandTailwindAtRules(context) {
if (env.OXIDE) {
// TODO: Pass through or implement `extractor`
for (let candidate of oxide.parseCandidateStringsFromFiles(
for (let candidate of require('@tailwindcss/oxide').parseCandidateStringsFromFiles(
context.changedContent
// Object.assign({}, builtInTransformers, context.tailwindConfig.content.transform)
)) {