feat: docker compose maybe
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)}`
|
||||
)
|
105
node_modules/tailwindcss/scripts/generate-types.js
generated
vendored
Normal file
105
node_modules/tailwindcss/scripts/generate-types.js
generated
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
import prettier from 'prettier'
|
||||
import { corePlugins } from '../src/corePlugins'
|
||||
import colors from '../src/public/colors'
|
||||
import defaultTheme from '../src/public/default-theme'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import * as types from './type-utils'
|
||||
|
||||
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',
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
const defaultThemeTypes = Object.entries(defaultTheme)
|
||||
.map(([name, value]) => {
|
||||
// Special cases for slightly more accurate types
|
||||
if (name === 'keyframes') {
|
||||
return [name, `Record<${types.forKeys(value)}, Record<string, CSSDeclarationList>>`]
|
||||
}
|
||||
|
||||
if (name === 'fontSize') {
|
||||
return [name, `Record<${types.forKeys(value)}, [string, { lineHeight: string }]>`]
|
||||
}
|
||||
|
||||
// General cases
|
||||
if (typeof value === 'string') {
|
||||
return [name, `string`]
|
||||
}
|
||||
|
||||
if (typeof value === 'function') {
|
||||
return [name, null]
|
||||
}
|
||||
|
||||
if (typeof value === 'object') {
|
||||
if (Object.keys(value).length === 0) {
|
||||
return [name, null]
|
||||
}
|
||||
|
||||
return [name, types.forValue(value)]
|
||||
}
|
||||
|
||||
return [name, `unknown`]
|
||||
})
|
||||
.filter(([, type]) => type !== null)
|
||||
.map(([name, type]) => `${name}: ${type}`)
|
||||
.join('\n')
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(process.cwd(), 'types', 'generated', 'default-theme.d.ts'),
|
||||
prettier.format(
|
||||
`
|
||||
import { Config } from '../../types'
|
||||
type CSSDeclarationList = Record<string, string>
|
||||
export type DefaultTheme = Config['theme'] & { ${defaultThemeTypes} }
|
||||
`,
|
||||
{
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
printWidth: 100,
|
||||
parser: 'typescript',
|
||||
}
|
||||
)
|
||||
)
|
18
node_modules/tailwindcss/scripts/release-channel.js
generated
vendored
Normal file
18
node_modules/tailwindcss/scripts/release-channel.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
// Given a version, figure out what the release channel is so that we can publish to the correct
|
||||
// channel on npm.
|
||||
//
|
||||
// E.g.:
|
||||
//
|
||||
// 1.2.3 -> latest (default)
|
||||
// 0.0.0-insiders.ffaa88 -> insiders
|
||||
// 4.1.0-alpha.4 -> alpha
|
||||
|
||||
let version =
|
||||
process.argv[2] || process.env.npm_package_version || require('../package.json').version
|
||||
|
||||
let match = /\d+\.\d+\.\d+-(.*)\.\d+/g.exec(version)
|
||||
if (match) {
|
||||
console.log(match[1])
|
||||
} else {
|
||||
console.log('latest')
|
||||
}
|
21
node_modules/tailwindcss/scripts/release-notes.js
generated
vendored
Normal file
21
node_modules/tailwindcss/scripts/release-notes.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Given a version, figure out what the release notes are so that we can use this to pre-fill the
|
||||
// relase notes on a GitHub release for the current version.
|
||||
|
||||
let path = require('path')
|
||||
let fs = require('fs')
|
||||
|
||||
let version =
|
||||
process.argv[2] || process.env.npm_package_version || require('../package.json').version
|
||||
|
||||
let changelog = fs.readFileSync(path.resolve(__dirname, '..', 'CHANGELOG.md'), 'utf8')
|
||||
let match = new RegExp(
|
||||
`## \\[${version}\\] - (.*)\\n\\n([\\s\\S]*?)\\n(?:(?:##\\s)|(?:\\[))`,
|
||||
'g'
|
||||
).exec(changelog)
|
||||
|
||||
if (match) {
|
||||
let [, , notes] = match
|
||||
console.log(notes.trim())
|
||||
} else {
|
||||
console.log(`Placeholder release notes for version: v${version}`)
|
||||
}
|
40
node_modules/tailwindcss/scripts/swap-engines.js
generated
vendored
Normal file
40
node_modules/tailwindcss/scripts/swap-engines.js
generated
vendored
Normal file
@ -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.'
|
||||
)
|
27
node_modules/tailwindcss/scripts/type-utils.js
generated
vendored
Normal file
27
node_modules/tailwindcss/scripts/type-utils.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
export function union(types) {
|
||||
return [...new Set(types)].join(' | ')
|
||||
}
|
||||
|
||||
export function unionValues(values) {
|
||||
return union(values.map(forValue))
|
||||
}
|
||||
|
||||
export function forKeys(value) {
|
||||
return union(Object.keys(value).map((key) => `'${key}'`))
|
||||
}
|
||||
|
||||
export function forValue(value) {
|
||||
if (Array.isArray(value)) {
|
||||
return `(${unionValues(value)})[]`
|
||||
}
|
||||
|
||||
if (typeof value === 'object') {
|
||||
return `Record<${forKeys(value)}, ${unionValues(Object.values(value))}>`
|
||||
}
|
||||
|
||||
if (typeof value === 'string') {
|
||||
return `string`
|
||||
}
|
||||
|
||||
return `any`
|
||||
}
|
Reference in New Issue
Block a user