This commit is contained in:
2025-05-09 05:30:08 +02:00
parent 7bb10e7df4
commit 73367bad9e
5322 changed files with 1266973 additions and 313 deletions

View File

@@ -0,0 +1,224 @@
/**
* Return array of browsers by selection queries.
*
* ```js
* browserslist('IE >= 10, IE 8') //=> ['ie 11', 'ie 10', 'ie 8']
* ```
*
* @param queries Browser queries.
* @param opts Options.
* @returns Array with browser names in Can I Use.
*/
declare function browserslist(
queries?: string | readonly string[] | null,
opts?: browserslist.Options
): string[]
declare namespace browserslist {
interface Query {
compose: 'or' | 'and'
type: string
query: string
not?: true
}
interface Options {
/**
* Path to processed file. It will be used to find config files.
*/
path?: string | false
/**
* Processing environment. It will be used to take right queries
* from config file.
*/
env?: string
/**
* Custom browser usage statistics for "> 1% in my stats" query.
*/
stats?: Stats | string
/**
* Path to config file with queries.
*/
config?: string
/**
* Do not throw on unknown version in direct query.
*/
ignoreUnknownVersions?: boolean
/**
* Throw an error if env is not found.
*/
throwOnMissing?: boolean
/**
* Disable security checks for extend query.
*/
dangerousExtend?: boolean
/**
* Alias mobile browsers to the desktop version when Can I Use
* doesnt have data about the specified version.
*/
mobileToDesktop?: boolean
}
type Config = {
defaults: string[]
[section: string]: string[] | undefined
}
interface Stats {
[browser: string]: {
[version: string]: number
}
}
/**
* Browser names aliases.
*/
let aliases: {
[alias: string]: string | undefined
}
/**
* Aliases to work with joined versions like `ios_saf 7.0-7.1`.
*/
let versionAliases: {
[browser: string]:
| {
[version: string]: string | undefined
}
| undefined
}
/**
* Can I Use only provides a few versions for some browsers (e.g. `and_chr`).
*
* Fallback to a similar browser for unknown versions.
*/
let desktopNames: {
[browser: string]: string | undefined
}
let data: {
[browser: string]:
| {
name: string
versions: string[]
released: string[]
releaseDate: {
[version: string]: number | undefined | null
}
}
| undefined
}
let nodeVersions: string[]
interface Usage {
[version: string]: number
}
let usage: {
global?: Usage
custom?: Usage | null
[country: string]: Usage | undefined | null
}
let cache: {
[feature: string]: {
[name: string]: {
[version: string]: string
}
}
}
/**
* Default browsers query
*/
let defaults: readonly string[]
/**
* Which statistics should be used. Country code or custom statistics.
* Pass `"my stats"` to load statistics from `Browserslist` files.
*/
type StatsOptions = string | 'my stats' | Stats | { dataByBrowser: Stats }
/**
* Return browsers market coverage.
*
* ```js
* browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1
* ```
*
* @param browsers Browsers names in Can I Use.
* @param stats Which statistics should be used.
* @returns Total market coverage for all selected browsers.
*/
function coverage(browsers: readonly string[], stats?: StatsOptions): number
/**
* Get queries AST to analyze the config content.
*
* @param queries Browser queries.
* @param opts Options.
* @returns An array of the data of each query in the config.
*/
function parse(
queries?: string | readonly string[] | null,
opts?: browserslist.Options
): Query[]
/**
* Return queries for specific file inside the project.
*
* ```js
* browserslist.loadConfig({
* file: process.cwd()
* }) ?? browserslist.defaults
* ```
*/
function loadConfig(options: LoadConfigOptions): string[] | undefined
function clearCaches(): void
function parseConfig(string: string): Config
function readConfig(file: string): Config
function findConfig(...pathSegments: string[]): Config | undefined
function findConfigFile(...pathSegments: string[]): string | undefined
interface LoadConfigOptions {
/**
* Path to config file
* */
config?: string
/**
* Path to file inside the project to find Browserslist config
* in closest folder
*/
path?: string
/**
* Environment to choose part of config.
*/
env?: string
}
}
declare global {
namespace NodeJS {
interface ProcessEnv {
BROWSERSLIST?: string
BROWSERSLIST_CONFIG?: string
BROWSERSLIST_DANGEROUS_EXTEND?: string
BROWSERSLIST_DISABLE_CACHE?: string
BROWSERSLIST_ENV?: string
BROWSERSLIST_IGNORE_OLD_DATA?: string
BROWSERSLIST_STATS?: string
BROWSERSLIST_ROOT_PATH?: string
}
}
}
export = browserslist

View File

@@ -0,0 +1 @@
module.exports={C:{"47":0.00116,"52":0.00347,"72":0.00232,"78":0.00116,"88":0.00116,"115":0.05558,"127":0.00232,"128":0.00695,"130":0.00116,"133":0.00116,"134":0.00232,"135":0.09148,"136":0.28024,"137":0.00116,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 79 80 81 82 83 84 85 86 87 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 129 131 132 138 139 140 3.5 3.6"},D:{"11":0.00232,"23":0.00232,"33":0.00232,"39":0.00116,"41":0.00116,"43":0.00232,"46":0.00116,"48":0.00116,"50":0.00463,"51":0.00116,"56":0.00116,"58":0.26055,"59":0.00116,"60":0.00116,"63":0.00116,"66":0.00347,"69":0.00116,"70":0.00347,"71":0.00579,"72":0.00347,"73":0.00926,"75":0.00232,"76":0.00116,"77":0.00811,"78":0.00116,"79":0.01737,"81":0.00116,"83":0.01158,"86":0.01042,"87":0.00347,"88":0.00463,"89":0.00116,"91":0.00232,"93":0.01853,"94":0.00116,"95":0.00232,"96":0.00116,"98":0.00463,"99":0.02779,"100":0.00116,"101":0.00232,"102":0.00695,"103":0.00463,"104":0.00232,"106":0.00116,"108":0.00116,"109":0.36477,"111":0.00232,"113":0.00232,"114":0.00579,"115":0.00116,"116":0.00463,"118":0.00347,"119":0.00811,"120":0.00926,"122":0.00232,"123":0.00232,"124":0.02779,"125":0.00695,"126":0.02663,"127":0.01042,"128":0.01853,"129":0.022,"130":0.01505,"131":0.08685,"132":0.10306,"133":1.27612,"134":2.08324,"135":0.00232,_:"4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 24 25 26 27 28 29 30 31 32 34 35 36 37 38 40 42 44 45 47 49 52 53 54 55 57 61 62 64 65 67 68 74 80 84 85 90 92 97 105 107 110 112 117 121 136 137 138"},F:{"79":0.00463,"85":0.00695,"87":0.00463,"88":0.00116,"95":0.02084,"113":0.00116,"114":0.00347,"116":0.02548,"117":0.36709,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 86 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.01274,"14":0.01042,"17":0.00116,"18":0.00347,"84":0.00232,"90":0.00232,"92":0.01158,"94":0.00232,"100":0.00116,"109":0.01042,"110":0.00116,"122":0.00116,"123":0.01969,"126":0.00116,"127":0.00116,"128":0.00116,"129":0.00347,"130":0.00116,"131":0.01274,"132":0.02663,"133":0.3335,"134":0.82334,_:"13 15 16 79 80 81 83 85 86 87 88 89 91 93 95 96 97 98 99 101 102 103 104 105 106 107 108 111 112 113 114 115 116 117 118 119 120 121 124 125"},E:{"13":0.00116,_:"0 4 5 6 7 8 9 10 11 12 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 16.2","5.1":0.00347,"13.1":0.00579,"14.1":0.00347,"15.5":0.00232,"15.6":0.044,"16.0":0.00116,"16.1":0.00463,"16.3":0.00579,"16.4":0.00116,"16.5":0.00232,"16.6":0.04053,"17.0":0.00116,"17.1":0.00347,"17.2":0.00579,"17.3":0.00579,"17.4":0.00347,"17.5":0.00695,"17.6":0.02779,"18.0":0.00695,"18.1":0.01042,"18.2":0.00695,"18.3":0.10885,"18.4":0.01158},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0035,"5.0-5.1":0,"6.0-6.1":0.01049,"7.0-7.1":0.00699,"8.1-8.4":0,"9.0-9.2":0.00524,"9.3":0.02447,"10.0-10.2":0.00175,"10.3":0.04021,"11.0-11.2":0.18529,"11.3-11.4":0.01224,"12.0-12.1":0.00699,"12.2-12.5":0.17306,"13.0-13.1":0.0035,"13.2":0.00524,"13.3":0.00699,"13.4-13.7":0.02447,"14.0-14.4":0.06118,"14.5-14.8":0.07342,"15.0-15.1":0.04021,"15.2-15.3":0.04021,"15.4":0.04895,"15.5":0.05594,"15.6-15.8":0.68874,"16.0":0.09789,"16.1":0.20103,"16.2":0.10488,"16.3":0.1818,"16.4":0.04021,"16.5":0.07517,"16.6-16.7":0.81635,"17.0":0.04895,"17.1":0.0874,"17.2":0.06643,"17.3":0.09265,"17.4":0.18529,"17.5":0.41254,"17.6-17.7":1.19742,"18.0":0.33563,"18.1":1.09778,"18.2":0.49121,"18.3":10.26638,"18.4":0.15208},P:{"4":0.03034,"20":0.01011,"21":0.1416,"22":0.37423,"23":0.19217,"24":0.8395,"25":0.39446,"26":0.82938,"27":2.25551,_:"5.0-5.4 6.2-6.4 8.2 10.1 15.0","7.2-7.4":1.20362,"9.2":0.01011,"11.1-11.2":0.02023,"12.0":0.01011,"13.0":0.03034,"14.0":0.02023,"16.0":0.08092,"17.0":0.02023,"18.0":0.06069,"19.0":0.36412},I:{"0":0.01765,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.60894,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00116,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.06189},Q:{"14.9":0.02653},O:{"0":0.07958},H:{"0":0.01},L:{"0":67.51218}};

View File

@@ -0,0 +1 @@
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}export function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}export default clsx;

View File

@@ -0,0 +1,48 @@
/**
* @fileoverview Rule to flag usage of __iterator__ property
* @author Ian Christian Myers
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const { getStaticPropertyName } = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow the use of the `__iterator__` property",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-iterator",
},
schema: [],
messages: {
noIterator: "Reserved name '__iterator__'.",
},
},
create(context) {
return {
MemberExpression(node) {
if (getStaticPropertyName(node) === "__iterator__") {
context.report({
node,
messageId: "noIterator",
});
}
},
};
},
};

View File

@@ -0,0 +1,91 @@
'use strict';
const path = require('path');
const resolveCommand = require('./util/resolveCommand');
const escape = require('./util/escape');
const readShebang = require('./util/readShebang');
const isWin = process.platform === 'win32';
const isExecutableRegExp = /\.(?:com|exe)$/i;
const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
function detectShebang(parsed) {
parsed.file = resolveCommand(parsed);
const shebang = parsed.file && readShebang(parsed.file);
if (shebang) {
parsed.args.unshift(parsed.file);
parsed.command = shebang;
return resolveCommand(parsed);
}
return parsed.file;
}
function parseNonShell(parsed) {
if (!isWin) {
return parsed;
}
// Detect & add support for shebangs
const commandFile = detectShebang(parsed);
// We don't need a shell if the command filename is an executable
const needsShell = !isExecutableRegExp.test(commandFile);
// If a shell is required, use cmd.exe and take care of escaping everything correctly
// Note that `forceShell` is an hidden option used only in tests
if (parsed.options.forceShell || needsShell) {
// Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
// The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
// Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
// we need to double escape them
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
// Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
// This is necessary otherwise it will always fail with ENOENT in those cases
parsed.command = path.normalize(parsed.command);
// Escape command & arguments
parsed.command = escape.command(parsed.command);
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
const shellCommand = [parsed.command].concat(parsed.args).join(' ');
parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
parsed.command = process.env.comspec || 'cmd.exe';
parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
}
return parsed;
}
function parse(command, args, options) {
// Normalize arguments, similar to nodejs
if (args && !Array.isArray(args)) {
options = args;
args = null;
}
args = args ? args.slice(0) : []; // Clone array to avoid changing the original
options = Object.assign({}, options); // Clone object to avoid changing the original
// Build our parsed object
const parsed = {
command,
args,
options,
file: undefined,
original: {
command,
args,
},
};
// Delegate further parsing to shell or non-shell
return options.shell ? parsed : parseNonShell(parsed);
}
module.exports = parse;

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _defineProperty;
var _toPropertyKey = require("./toPropertyKey.js");
function _defineProperty(obj, key, value) {
key = (0, _toPropertyKey.default)(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
//# sourceMappingURL=defineProperty.js.map

View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _defineAccessor;
function _defineAccessor(type, obj, key, fn) {
var desc = {
configurable: true,
enumerable: true
};
desc[type] = fn;
return Object.defineProperty(obj, key, desc);
}
//# sourceMappingURL=defineAccessor.js.map

View File

@@ -0,0 +1,5 @@
export * from './derived.cjs';
export * from './effect.cjs';
export * from './store.cjs';
export * from './types.cjs';
export * from './scheduler.cjs';

View File

@@ -0,0 +1,125 @@
/**
* @fileoverview Shared functions to work with configs.
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
/** @typedef {import("../shared/types").Rule} Rule */
//------------------------------------------------------------------------------
// Private Members
//------------------------------------------------------------------------------
// JSON schema that disallows passing any options
const noOptionsSchema = Object.freeze({
type: "array",
minItems: 0,
maxItems: 0,
});
//-----------------------------------------------------------------------------
// Functions
//-----------------------------------------------------------------------------
/**
* Parses a ruleId into its plugin and rule parts.
* @param {string} ruleId The rule ID to parse.
* @returns {{pluginName:string,ruleName:string}} The plugin and rule
* parts of the ruleId;
*/
function parseRuleId(ruleId) {
let pluginName, ruleName;
// distinguish between core rules and plugin rules
if (ruleId.includes("/")) {
// mimic scoped npm packages
if (ruleId.startsWith("@")) {
pluginName = ruleId.slice(0, ruleId.lastIndexOf("/"));
} else {
pluginName = ruleId.slice(0, ruleId.indexOf("/"));
}
ruleName = ruleId.slice(pluginName.length + 1);
} else {
pluginName = "@";
ruleName = ruleId;
}
return {
pluginName,
ruleName,
};
}
/**
* Retrieves a rule instance from a given config based on the ruleId.
* @param {string} ruleId The rule ID to look for.
* @param {FlatConfig} config The config to search.
* @returns {import("../shared/types").Rule|undefined} The rule if found
* or undefined if not.
*/
function getRuleFromConfig(ruleId, config) {
const { pluginName, ruleName } = parseRuleId(ruleId);
return config.plugins?.[pluginName]?.rules?.[ruleName];
}
/**
* Gets a complete options schema for a rule.
* @param {Rule} rule A rule object
* @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`.
* @returns {Object|null} JSON Schema for the rule's options. `null` if `meta.schema` is `false`.
*/
function getRuleOptionsSchema(rule) {
if (!rule.meta) {
return { ...noOptionsSchema }; // default if `meta.schema` is not specified
}
const schema = rule.meta.schema;
if (typeof schema === "undefined") {
return { ...noOptionsSchema }; // default if `meta.schema` is not specified
}
// `schema:false` is an allowed explicit opt-out of options validation for the rule
if (schema === false) {
return null;
}
if (typeof schema !== "object" || schema === null) {
throw new TypeError("Rule's `meta.schema` must be an array or object");
}
// ESLint-specific array form needs to be converted into a valid JSON Schema definition
if (Array.isArray(schema)) {
if (schema.length) {
return {
type: "array",
items: schema,
minItems: 0,
maxItems: schema.length,
};
}
// `schema:[]` is an explicit way to specify that the rule does not accept any options
return { ...noOptionsSchema };
}
// `schema:<object>` is assumed to be a valid JSON Schema definition
return schema;
}
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
module.exports = {
parseRuleId,
getRuleFromConfig,
getRuleOptionsSchema,
};

View File

@@ -0,0 +1,89 @@
{
"name": "nanoid",
"version": "3.3.11",
"description": "A tiny (116 bytes), secure URL-friendly unique string ID generator",
"keywords": [
"uuid",
"random",
"id",
"url"
],
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"author": "Andrey Sitnik <andrey@sitnik.ru>",
"license": "MIT",
"repository": "ai/nanoid",
"browser": {
"./index.js": "./index.browser.js",
"./async/index.js": "./async/index.browser.js",
"./async/index.cjs": "./async/index.browser.cjs",
"./index.cjs": "./index.browser.cjs"
},
"react-native": "index.js",
"bin": "./bin/nanoid.cjs",
"sideEffects": false,
"types": "./index.d.ts",
"type": "module",
"main": "index.cjs",
"module": "index.js",
"exports": {
".": {
"react-native": "./index.browser.js",
"browser": "./index.browser.js",
"require": {
"types": "./index.d.cts",
"default": "./index.cjs"
},
"import": {
"types": "./index.d.ts",
"default": "./index.js"
},
"default": "./index.js"
},
"./package.json": "./package.json",
"./async/package.json": "./async/package.json",
"./async": {
"browser": "./async/index.browser.js",
"require": {
"types": "./index.d.cts",
"default": "./async/index.cjs"
},
"import": {
"types": "./index.d.ts",
"default": "./async/index.js"
},
"default": "./async/index.js"
},
"./non-secure/package.json": "./non-secure/package.json",
"./non-secure": {
"require": {
"types": "./index.d.cts",
"default": "./non-secure/index.cjs"
},
"import": {
"types": "./index.d.ts",
"default": "./non-secure/index.js"
},
"default": "./non-secure/index.js"
},
"./url-alphabet/package.json": "./url-alphabet/package.json",
"./url-alphabet": {
"require": {
"types": "./index.d.cts",
"default": "./url-alphabet/index.cjs"
},
"import": {
"types": "./index.d.ts",
"default": "./url-alphabet/index.js"
},
"default": "./url-alphabet/index.js"
}
}
}

View File

@@ -0,0 +1,219 @@
const {
MAX_SAFE_COMPONENT_LENGTH,
MAX_SAFE_BUILD_LENGTH,
MAX_LENGTH,
} = require('./constants')
const debug = require('./debug')
exports = module.exports = {}
// The actual regexps go on exports.re
const re = exports.re = []
const safeRe = exports.safeRe = []
const src = exports.src = []
const safeSrc = exports.safeSrc = []
const t = exports.t = {}
let R = 0
const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
// used internally via the safeRe object since all inputs in this library get
// normalized first to trim and collapse all extra whitespace. The original
// regexes are exported for userland consumption and lower level usage. A
// future breaking change could export the safer regex only with a note that
// all input should have extra whitespace removed.
const safeRegexReplacements = [
['\\s', 1],
['\\d', MAX_LENGTH],
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
]
const makeSafeRegex = (value) => {
for (const [token, max] of safeRegexReplacements) {
value = value
.split(`${token}*`).join(`${token}{0,${max}}`)
.split(`${token}+`).join(`${token}{1,${max}}`)
}
return value
}
const createToken = (name, value, isGlobal) => {
const safe = makeSafeRegex(value)
const index = R++
debug(name, index, value)
t[name] = index
src[index] = value
safeSrc[index] = safe
re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
}
// The following Regular Expressions can be used for tokenizing,
// validating, and parsing SemVer version strings.
// ## Numeric Identifier
// A single `0`, or a non-zero digit followed by zero or more digits.
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
// ## Non-numeric Identifier
// Zero or more digits, followed by a letter or hyphen, and then zero or
// more letters, digits, or hyphens.
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
// ## Main Version
// Three dot-separated numeric identifiers.
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
`(${src[t.NUMERICIDENTIFIER]})\\.` +
`(${src[t.NUMERICIDENTIFIER]})`)
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
`(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
`(${src[t.NUMERICIDENTIFIERLOOSE]})`)
// ## Pre-release Version Identifier
// A numeric identifier, or a non-numeric identifier.
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
}|${src[t.NONNUMERICIDENTIFIER]})`)
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
}|${src[t.NONNUMERICIDENTIFIER]})`)
// ## Pre-release Version
// Hyphen, followed by one or more dot-separated pre-release version
// identifiers.
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)
// ## Build Metadata Identifier
// Any combination of digits, letters, or hyphens.
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
// ## Build Metadata
// Plus sign, followed by one or more period-separated build metadata
// identifiers.
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)
// ## Full Version String
// A main version, followed optionally by a pre-release version and
// build metadata.
// Note that the only major, minor, patch, and pre-release sections of
// the version string are capturing groups. The build metadata is not a
// capturing group, because it should not ever be used in version
// comparison.
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
}${src[t.PRERELEASE]}?${
src[t.BUILD]}?`)
createToken('FULL', `^${src[t.FULLPLAIN]}$`)
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
// common in the npm registry.
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
}${src[t.PRERELEASELOOSE]}?${
src[t.BUILD]}?`)
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
createToken('GTLT', '((?:<|>)?=?)')
// Something like "2.*" or "1.2.x".
// Note that "x.x" is a valid xRange identifer, meaning "any version"
// Only the first item is strictly required.
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
`(?:${src[t.PRERELEASE]})?${
src[t.BUILD]}?` +
`)?)?`)
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
`(?:${src[t.PRERELEASELOOSE]})?${
src[t.BUILD]}?` +
`)?)?`)
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
// Coercion.
// Extract anything that could conceivably be a part of a valid semver
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
createToken('COERCEFULL', src[t.COERCEPLAIN] +
`(?:${src[t.PRERELEASE]})?` +
`(?:${src[t.BUILD]})?` +
`(?:$|[^\\d])`)
createToken('COERCERTL', src[t.COERCE], true)
createToken('COERCERTLFULL', src[t.COERCEFULL], true)
// Tilde ranges.
// Meaning is "reasonably at or greater than"
createToken('LONETILDE', '(?:~>?)')
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
exports.tildeTrimReplace = '$1~'
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)
// Caret ranges.
// Meaning is "at least and backwards compatible with"
createToken('LONECARET', '(?:\\^)')
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
exports.caretTrimReplace = '$1^'
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)
// A simple gt/lt/eq thing, or just "" to indicate "any version"
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)
// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
exports.comparatorTrimReplace = '$1$2$3'
// Something like `1.2.3 - 1.2.4`
// Note that these all use the loose form, because they'll be
// checked against either the strict or loose comparator form
// later.
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
`\\s+-\\s+` +
`(${src[t.XRANGEPLAIN]})` +
`\\s*$`)
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
`\\s+-\\s+` +
`(${src[t.XRANGEPLAINLOOSE]})` +
`\\s*$`)
// Star ranges basically just allow anything at all.
createToken('STAR', '(<|>)?=?\\s*\\*')
// >=0.0.0 is like a star
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')

View File

@@ -0,0 +1,19 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,86 @@
{
"name": "tailwindcss",
"version": "4.1.2",
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/tailwindlabs/tailwindcss.git",
"directory": "packages/tailwindcss"
},
"bugs": "https://github.com/tailwindlabs/tailwindcss/issues",
"homepage": "https://tailwindcss.com",
"exports": {
".": {
"types": "./dist/lib.d.mts",
"style": "./index.css",
"require": "./dist/lib.js",
"import": "./dist/lib.mjs"
},
"./plugin": {
"require": "./dist/plugin.js",
"import": "./dist/plugin.mjs"
},
"./plugin.js": {
"require": "./dist/plugin.js",
"import": "./dist/plugin.mjs"
},
"./defaultTheme": {
"require": "./dist/default-theme.js",
"import": "./dist/default-theme.mjs"
},
"./defaultTheme.js": {
"require": "./dist/default-theme.js",
"import": "./dist/default-theme.mjs"
},
"./colors": {
"require": "./dist/colors.js",
"import": "./dist/colors.mjs"
},
"./colors.js": {
"require": "./dist/colors.js",
"import": "./dist/colors.mjs"
},
"./lib/util/flattenColorPalette": {
"require": "./dist/flatten-color-palette.js",
"import": "./dist/flatten-color-palette.mjs"
},
"./lib/util/flattenColorPalette.js": {
"require": "./dist/flatten-color-palette.js",
"import": "./dist/flatten-color-palette.mjs"
},
"./package.json": "./package.json",
"./index.css": "./index.css",
"./index": "./index.css",
"./preflight.css": "./preflight.css",
"./preflight": "./preflight.css",
"./theme.css": "./theme.css",
"./theme": "./theme.css",
"./utilities.css": "./utilities.css",
"./utilities": "./utilities.css"
},
"publishConfig": {
"provenance": true,
"access": "public"
},
"style": "index.css",
"files": [
"dist",
"index.css",
"preflight.css",
"theme.css",
"utilities.css"
],
"devDependencies": {
"@types/node": "^20.14.8",
"lightningcss": "1.29.2",
"dedent": "1.5.3",
"@tailwindcss/oxide": "^4.1.2"
},
"scripts": {
"lint": "tsc --noEmit",
"build": "tsup-node --env.NODE_ENV production",
"dev": "tsup-node --env.NODE_ENV development --watch",
"test:ui": "playwright test"
}
}

View File

@@ -0,0 +1,28 @@
import { useReducer } from 'react';
type State<T> =
| { value: T; error: undefined }
| { value: false; error: Error }
| { value: undefined; error: undefined };
type Action<T> =
| { type: 'RESOLVE'; value: T }
| { type: 'REJECT'; error: Error }
| { type: 'RESET' };
function reducer<T>(state: State<T>, action: Action<T>): State<T> {
switch (action.type) {
case 'RESOLVE':
return { value: action.value, error: undefined };
case 'REJECT':
return { value: false, error: action.error };
case 'RESET':
return { value: undefined, error: undefined };
default:
return state;
}
}
export default function useResolver<T>(): [State<T>, React.Dispatch<Action<T>>] {
return useReducer(reducer<T>, { value: undefined, error: undefined });
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","2":"K D mC","129":"E F"},B:{"1":"0 9 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC"},D:{"1":"0 6 7 8 9 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 J PB K D E F A B C L M G N O P QB"},E:{"1":"D E F A B C L M G vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K sC SC tC uC"},F:{"1":"0 1 2 3 4 5 6 7 8 C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GC","129":"F B 4C 5C 6C 7C FC kC 8C"},G:{"1":"E CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"SC 9C lC AD BD"},H:{"1":"WD"},I:{"1":"I bD cD","2":"LC J XD YD ZD aD lC"},J:{"2":"D A"},K:{"1":"H GC","2":"A B C FC kC"},L:{"1":"I"},M:{"2":"EC"},N:{"1":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"2":"qD rD"}},B:2,C:"CSS widows & orphans",D:true};

View File

@@ -0,0 +1,36 @@
%%Copyright: -----------------------------------------------------------
%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.
%%Copyright: All rights reserved.
%%Copyright:
%%Copyright: Redistribution and use in source and binary forms, with or
%%Copyright: without modification, are permitted provided that the
%%Copyright: following conditions are met:
%%Copyright:
%%Copyright: Redistributions of source code must retain the above
%%Copyright: copyright notice, this list of conditions and the following
%%Copyright: disclaimer.
%%Copyright:
%%Copyright: Redistributions in binary form must reproduce the above
%%Copyright: copyright notice, this list of conditions and the following
%%Copyright: disclaimer in the documentation and/or other materials
%%Copyright: provided with the distribution.
%%Copyright:
%%Copyright: Neither the name of Adobe Systems Incorporated nor the names
%%Copyright: of its contributors may be used to endorse or promote
%%Copyright: products derived from this software without specific prior
%%Copyright: written permission.
%%Copyright:
%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
%%Copyright: CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%%Copyright: -----------------------------------------------------------