unplugin-inline-enum
Advanced tools
Comparing version
@@ -1,48 +0,48 @@ | ||
import { O as OptionsResolved } from './options.d-Bl2evHTf.js'; | ||
export { a as Options, r as resolveOptions } from './options.d-Bl2evHTf.js'; | ||
import { O as OptionsResolved } from './options.d-CXgzbWXw.js'; | ||
export { a as Options, r as resolveOptions } from './options.d-CXgzbWXw.js'; | ||
import 'unplugin-utils'; | ||
/** | ||
* Represents the scan options for the enum. | ||
*/ | ||
type ScanOptions = Pick<OptionsResolved, 'scanDir' | 'scanMode' | 'scanPattern'>; | ||
* Represents the scan options for the enum. | ||
*/ | ||
type ScanOptions = Pick<OptionsResolved, "scanDir" | "scanMode" | "scanPattern">; | ||
/** | ||
* Represents a member of an enum. | ||
*/ | ||
* Represents a member of an enum. | ||
*/ | ||
interface EnumMember { | ||
readonly name: string; | ||
readonly value: string | number; | ||
readonly name: string; | ||
readonly value: string | number; | ||
} | ||
/** | ||
* Represents a declaration of an enum. | ||
*/ | ||
* Represents a declaration of an enum. | ||
*/ | ||
interface EnumDeclaration { | ||
readonly id: string; | ||
readonly range: readonly [start: number, end: number]; | ||
readonly members: ReadonlyArray<EnumMember>; | ||
readonly id: string; | ||
readonly range: readonly [start: number, end: number]; | ||
readonly members: ReadonlyArray<EnumMember>; | ||
} | ||
/** | ||
* Represents the data of all enums. | ||
*/ | ||
* Represents the data of all enums. | ||
*/ | ||
interface EnumData { | ||
readonly declarations: { | ||
readonly [file: string]: ReadonlyArray<EnumDeclaration>; | ||
}; | ||
readonly defines: { | ||
readonly [id_key: `${string}.${string}`]: string; | ||
}; | ||
readonly declarations: { | ||
readonly [file: string]: ReadonlyArray<EnumDeclaration> | ||
}; | ||
readonly defines: { | ||
readonly [id_key: `${string}.${string}`]: string | ||
}; | ||
} | ||
/** | ||
* Scans the specified directory for enums based on the provided options. | ||
* @param options - The scan options for the enum. | ||
* @returns The data of all enums found. | ||
*/ | ||
* Scans the specified directory for enums based on the provided options. | ||
* @param options - The scan options for the enum. | ||
* @returns The data of all enums found. | ||
*/ | ||
declare function scanEnums(options: ScanOptions): EnumData; | ||
/** | ||
* Scans the specified directory for files based on the provided options. | ||
* @param options - The scan options for the files. | ||
* @returns The list of files found. | ||
*/ | ||
* Scans the specified directory for files based on the provided options. | ||
* @param options - The scan options for the files. | ||
* @returns The list of files found. | ||
*/ | ||
declare function scanFiles(options: ScanOptions): string[]; | ||
export { type EnumData, type EnumDeclaration, type EnumMember, type ScanOptions, scanEnums, scanFiles }; |
import plugin from './index.js'; | ||
import 'unplugin'; | ||
import './options.d-Bl2evHTf.js'; | ||
import './options.d-CXgzbWXw.js'; | ||
import 'unplugin-utils'; | ||
/** | ||
* This entry file is for esbuild plugin. | ||
* | ||
* @module | ||
*/ | ||
* This entry file is for esbuild plugin. | ||
* | ||
* @module | ||
*/ | ||
/** | ||
* Esbuild plugin | ||
* | ||
* @example | ||
* ```ts | ||
* // esbuild.config.js | ||
* import { build } from 'esbuild' | ||
* | ||
* build({ | ||
* plugins: [require('unplugin-inline-enum/esbuild')()], | ||
* }) | ||
* ``` | ||
*/ | ||
* Esbuild plugin | ||
* | ||
* @example | ||
* ```ts | ||
* // esbuild.config.js | ||
* import { build } from 'esbuild' | ||
* | ||
* build({ | ||
* plugins: [require('unplugin-inline-enum/esbuild')()], | ||
* }) | ||
* ``` | ||
*/ | ||
declare const esbuild: typeof plugin.esbuild; | ||
export { esbuild as 'module.exports', esbuild as default }; | ||
export { esbuild as "module.exports", esbuild as default }; |
import { UnpluginInstance } from 'unplugin'; | ||
import { a as Options } from './options.d-Bl2evHTf.js'; | ||
import { a as Options } from './options.d-CXgzbWXw.js'; | ||
import 'unplugin-utils'; | ||
/** | ||
* This entry file is for main unplugin. | ||
* @module | ||
*/ | ||
/** | ||
* The main unplugin instance. | ||
*/ | ||
* The main unplugin instance. | ||
*/ | ||
declare const plugin: UnpluginInstance<Options | undefined, true>; | ||
export { plugin as default }; |
import plugin from './index.js'; | ||
import 'unplugin'; | ||
import './options.d-Bl2evHTf.js'; | ||
import './options.d-CXgzbWXw.js'; | ||
import 'unplugin-utils'; | ||
/** | ||
* This entry file is for Rollup plugin. | ||
* | ||
* @module | ||
*/ | ||
* This entry file is for Rollup plugin. | ||
* | ||
* @module | ||
*/ | ||
/** | ||
* Rollup plugin | ||
* | ||
* @example | ||
* ```ts | ||
* // rollup.config.js | ||
* import InlineEnum from 'unplugin-inline-enum/rollup' | ||
* | ||
* export default { | ||
* plugins: [InlineEnum()], | ||
* } | ||
* ``` | ||
*/ | ||
* Rollup plugin | ||
* | ||
* @example | ||
* ```ts | ||
* // rollup.config.js | ||
* import InlineEnum from 'unplugin-inline-enum/rollup' | ||
* | ||
* export default { | ||
* plugins: [InlineEnum()], | ||
* } | ||
* ``` | ||
*/ | ||
declare const rollup: typeof plugin.rollup; | ||
export { rollup as 'module.exports', rollup as default }; | ||
export { rollup as "module.exports", rollup as default }; |
import plugin from './index.js'; | ||
import 'unplugin'; | ||
import './options.d-Bl2evHTf.js'; | ||
import './options.d-CXgzbWXw.js'; | ||
import 'unplugin-utils'; | ||
/** | ||
* This entry file is for Vite plugin. | ||
* | ||
* @module | ||
*/ | ||
* This entry file is for Vite plugin. | ||
* | ||
* @module | ||
*/ | ||
/** | ||
* Vite plugin | ||
* | ||
* @example | ||
* ```ts | ||
* // vite.config.ts | ||
* import InlineEnum from 'unplugin-inline-enum/vite' | ||
* | ||
* export default defineConfig({ | ||
* plugins: [InlineEnum()], | ||
* }) | ||
* ``` | ||
*/ | ||
* Vite plugin | ||
* | ||
* @example | ||
* ```ts | ||
* // vite.config.ts | ||
* import InlineEnum from 'unplugin-inline-enum/vite' | ||
* | ||
* export default defineConfig({ | ||
* plugins: [InlineEnum()], | ||
* }) | ||
* ``` | ||
*/ | ||
declare const vite: typeof plugin.vite; | ||
export { vite as 'module.exports', vite as default }; | ||
export { vite as "module.exports", vite as default }; |
import plugin from './index.js'; | ||
import 'unplugin'; | ||
import './options.d-Bl2evHTf.js'; | ||
import './options.d-CXgzbWXw.js'; | ||
import 'unplugin-utils'; | ||
/** | ||
* This entry file is for webpack plugin. | ||
* | ||
* @module | ||
*/ | ||
* This entry file is for webpack plugin. | ||
* | ||
* @module | ||
*/ | ||
/** | ||
* Webpack plugin | ||
* | ||
* @example | ||
* ```ts | ||
* // webpack.config.js | ||
* module.exports = { | ||
* plugins: [require('unplugin-inline-enum/webpack')()], | ||
* } | ||
* ``` | ||
*/ | ||
* Webpack plugin | ||
* | ||
* @example | ||
* ```ts | ||
* // webpack.config.js | ||
* module.exports = { | ||
* plugins: [require('unplugin-inline-enum/webpack')()], | ||
* } | ||
* ``` | ||
*/ | ||
declare const webpack: typeof plugin.webpack; | ||
export { webpack as 'module.exports', webpack as default }; | ||
export { webpack as "module.exports", webpack as default }; |
{ | ||
"name": "unplugin-inline-enum", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Inline enum values to optimize bundle size.", | ||
@@ -22,3 +22,4 @@ "type": "module", | ||
}, | ||
"author": "三咲智子 <sxzz@sxzz.moe>", | ||
"author": "三咲智子 Kevin Deng <sxzz@sxzz.moe>", | ||
"funding": "https://github.com/sponsors/sxzz", | ||
"files": [ | ||
@@ -61,20 +62,20 @@ "dist" | ||
"devDependencies": { | ||
"@babel/types": "^7.26.8", | ||
"@sxzz/eslint-config": "^5.1.0", | ||
"@sxzz/prettier-config": "^2.1.2", | ||
"@babel/types": "^7.26.9", | ||
"@sxzz/eslint-config": "^5.2.0", | ||
"@sxzz/prettier-config": "^2.2.0", | ||
"@sxzz/test-utils": "^0.5.1", | ||
"@types/node": "^22.13.1", | ||
"@types/node": "^22.13.9", | ||
"@types/picomatch": "^3.0.2", | ||
"bumpp": "^10.0.3", | ||
"esbuild": "^0.25.0", | ||
"eslint": "^9.20.1", | ||
"prettier": "^3.5.0", | ||
"rollup": "^4.34.6", | ||
"tsdown": "^0.5.9", | ||
"tsx": "^4.19.2", | ||
"typescript": "^5.7.3", | ||
"unplugin-oxc": "^0.2.4", | ||
"vite": "^6.1.0", | ||
"vitest": "^3.0.5", | ||
"webpack": "^5.97.1" | ||
"eslint": "^9.21.0", | ||
"prettier": "^3.5.3", | ||
"rollup": "^4.34.9", | ||
"tsdown": "^0.6.3", | ||
"tsx": "^4.19.3", | ||
"typescript": "^5.8.2", | ||
"unplugin-oxc": "^0.2.6", | ||
"vite": "^6.2.0", | ||
"vitest": "^3.0.7", | ||
"webpack": "^5.98.0" | ||
}, | ||
@@ -81,0 +82,0 @@ "engines": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1
-50%18538
-1.01%434
-0.23%