forked from hero/www_hero
hero_web
This commit is contained in:
10
node_modules/tailwindcss/scripts/create-plugin-list.js
generated
vendored
Normal file
10
node_modules/tailwindcss/scripts/create-plugin-list.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { corePlugins } from '../src/corePlugins'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
let corePluginList = Object.keys(corePlugins)
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(process.cwd(), 'src', 'corePluginList.js'),
|
||||
`export default ${JSON.stringify(corePluginList)}`
|
||||
)
|
52
node_modules/tailwindcss/scripts/generate-types.js
generated
vendored
Normal file
52
node_modules/tailwindcss/scripts/generate-types.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import prettier from 'prettier'
|
||||
import { corePlugins } from '../src/corePlugins'
|
||||
import colors from '../src/public/colors'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(process.cwd(), 'types', 'generated', 'corePluginList.d.ts'),
|
||||
`export type CorePluginList = ${Object.keys(corePlugins)
|
||||
.map((p) => `'${p}'`)
|
||||
.join(' | ')}`
|
||||
)
|
||||
|
||||
let colorsWithoutDeprecatedColors = Object.fromEntries(
|
||||
Object.entries(Object.getOwnPropertyDescriptors(colors))
|
||||
.filter(([_, { value }]) => {
|
||||
return typeof value !== 'undefined'
|
||||
})
|
||||
.map(([name, definition]) => [name, definition.value])
|
||||
)
|
||||
|
||||
let deprecatedColors = Object.entries(Object.getOwnPropertyDescriptors(colors))
|
||||
.filter(([_, { value }]) => {
|
||||
return typeof value === 'undefined'
|
||||
})
|
||||
.map(([name, definition]) => {
|
||||
let warn = console.warn
|
||||
let messages = []
|
||||
console.warn = (...args) => messages.push(args.pop())
|
||||
definition.get()
|
||||
console.warn = warn
|
||||
let message = messages.join(' ').trim()
|
||||
let newColor = message.match(/renamed to `(.*)`/)[1]
|
||||
return `/** @deprecated ${message} */${name}: DefaultColors['${newColor}'],`
|
||||
})
|
||||
.join('\n')
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(process.cwd(), 'types', 'generated', 'colors.d.ts'),
|
||||
prettier.format(
|
||||
`export interface DefaultColors { ${JSON.stringify(colorsWithoutDeprecatedColors).slice(
|
||||
1,
|
||||
-1
|
||||
)}\n${deprecatedColors}\n}`,
|
||||
{
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
printWidth: 100,
|
||||
parser: 'typescript',
|
||||
}
|
||||
)
|
||||
)
|
27
node_modules/tailwindcss/scripts/install-integrations.js
generated
vendored
Normal file
27
node_modules/tailwindcss/scripts/install-integrations.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
let fs = require('fs/promises')
|
||||
let { spawn } = require('child_process')
|
||||
let path = require('path')
|
||||
let root = process.cwd()
|
||||
|
||||
function npmInstall(cwd) {
|
||||
return new Promise((resolve) => {
|
||||
let childProcess = spawn('npm', ['install'], { cwd })
|
||||
childProcess.on('exit', resolve)
|
||||
})
|
||||
}
|
||||
|
||||
async function install() {
|
||||
let base = path.resolve(root, 'integrations')
|
||||
let ignoreFolders = ['node_modules']
|
||||
let integrations = (await fs.readdir(base, { withFileTypes: true }))
|
||||
.filter((integration) => integration.isDirectory())
|
||||
.filter((integration) => !ignoreFolders.includes(integration.name))
|
||||
.map((folder) => path.resolve(base, folder.name))
|
||||
.concat([base])
|
||||
.map((integration) => npmInstall(integration))
|
||||
|
||||
await Promise.all(integrations)
|
||||
console.log('Done!')
|
||||
}
|
||||
|
||||
install()
|
68
node_modules/tailwindcss/scripts/rebuildFixtures.js
generated
vendored
Normal file
68
node_modules/tailwindcss/scripts/rebuildFixtures.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import fs from 'fs'
|
||||
import postcss from 'postcss'
|
||||
import tailwind from '..'
|
||||
|
||||
function build({ from, to, config }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(`Processing ./${from}...`)
|
||||
|
||||
fs.readFile(`./${from}`, (err, css) => {
|
||||
if (err) throw err
|
||||
|
||||
return postcss([tailwind(config)])
|
||||
.process(css, {
|
||||
from: undefined,
|
||||
})
|
||||
.then((result) => {
|
||||
fs.writeFileSync(`./${to}`, result.css)
|
||||
return result
|
||||
})
|
||||
.then(resolve)
|
||||
.catch((error) => {
|
||||
console.log(error)
|
||||
reject()
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
console.info('\nRebuilding fixtures...\n')
|
||||
|
||||
Promise.all([
|
||||
build({
|
||||
from: 'tests/fixtures/tailwind-input.css',
|
||||
to: 'tests/fixtures/tailwind-output.css',
|
||||
config: {},
|
||||
}),
|
||||
build({
|
||||
from: 'tests/fixtures/tailwind-input.css',
|
||||
to: 'tests/fixtures/tailwind-output-important.css',
|
||||
config: { important: true },
|
||||
}),
|
||||
build({
|
||||
from: 'tests/fixtures/tailwind-input.css',
|
||||
to: 'tests/fixtures/tailwind-output-no-color-opacity.css',
|
||||
config: {
|
||||
corePlugins: {
|
||||
textOpacity: false,
|
||||
backgroundOpacity: false,
|
||||
borderOpacity: false,
|
||||
placeholderOpacity: false,
|
||||
divideOpacity: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
build({
|
||||
from: 'tests/fixtures/tailwind-input.css',
|
||||
to: 'tests/fixtures/tailwind-output-flagged.css',
|
||||
config: {
|
||||
future: 'all',
|
||||
experimental: 'all',
|
||||
},
|
||||
}),
|
||||
]).then(() => {
|
||||
console.log('\nFinished rebuilding fixtures.')
|
||||
console.log(
|
||||
'\nPlease triple check that the fixture output matches what you expect before committing this change.'
|
||||
)
|
||||
})
|
Reference in New Issue
Block a user