Comparing version 0.0.0 to 0.0.1
@@ -1,6 +0,29 @@ | ||
interface LoadConfigSource { | ||
declare const defaultExtensions: string[]; | ||
declare type ConfigLoaderType = 'bundle' | 'json'; | ||
interface LoadConfigSource<T = any> { | ||
files: string[]; | ||
rewrite: (obj: any, filepath: string) => Promise<any> | any; | ||
/** | ||
* @default ['mts', 'cts', 'ts', 'mjs', 'cjs', 'js', 'json', ''] | ||
*/ | ||
extensions?: string[]; | ||
/** | ||
* Loader for loading config, | ||
* | ||
* @default 'auto' | ||
*/ | ||
loader?: ConfigLoaderType | 'auto'; | ||
/** | ||
* Rewrite the config object | ||
*/ | ||
rewrite?: <F = any>(obj: F, filepath: string, loader: ConfigLoaderType) => Promise<T | undefined> | T | undefined; | ||
} | ||
interface LoadConfigOptions { | ||
interface SearchOptions { | ||
/** | ||
* Root directory | ||
* | ||
* @default process.cwd() | ||
*/ | ||
cwd?: string; | ||
} | ||
interface LoadConfigOptions extends SearchOptions { | ||
sources: LoadConfigSource[]; | ||
@@ -10,8 +33,20 @@ } | ||
config: T; | ||
filename: string; | ||
filepath: string; | ||
dependencies?: string[]; | ||
mtime: number; | ||
} | ||
interface LoadVitePluginConfigOptions { | ||
pluginNames: string[]; | ||
} | ||
interface LoadObjectFieldOptions { | ||
fields: string[]; | ||
} | ||
declare function loadVitePluginConfig(options: LoadVitePluginConfigOptions): LoadConfigSource; | ||
declare function loadViteConfigFields(options: LoadObjectFieldOptions): LoadConfigSource; | ||
declare function loadPackageJsonFields(options: LoadObjectFieldOptions): LoadConfigSource; | ||
declare function loadConfig<T>(options?: LoadConfigOptions): Promise<LoadConfigResult<T> | undefined>; | ||
declare function loadConfigFromSource<T>(source: LoadConfigSource): Promise<LoadConfigResult<T> | undefined>; | ||
declare function loadConfigFromSource<T>(source: LoadConfigSource<T>, search?: SearchOptions): Promise<LoadConfigResult<T> | undefined>; | ||
export { LoadConfigOptions, LoadConfigResult, LoadConfigSource, loadConfig, loadConfigFromSource }; | ||
export { ConfigLoaderType, LoadConfigOptions, LoadConfigResult, LoadConfigSource, LoadObjectFieldOptions, LoadVitePluginConfigOptions, SearchOptions, defaultExtensions, loadConfig, loadConfigFromSource, loadPackageJsonFields, loadViteConfigFields, loadVitePluginConfig }; |
{ | ||
"name": "unconfig", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Load config universally", | ||
@@ -31,11 +31,2 @@ "keywords": [], | ||
], | ||
"scripts": { | ||
"build": "unbuild", | ||
"dev": "unbuild --stub", | ||
"lint": "eslint \"{src,test}/**/*.ts\"", | ||
"prepublishOnly": "nr build", | ||
"release": "bumpp --commit --push --tag && pnpm publish", | ||
"start": "esno src/index.ts", | ||
"test": "jest" | ||
}, | ||
"devDependencies": { | ||
@@ -50,3 +41,2 @@ "@antfu/eslint-config": "^0.11.1", | ||
"esno": "^0.12.1", | ||
"find-up": "^6.2.0", | ||
"jest": "^27.3.1", | ||
@@ -56,3 +46,15 @@ "ts-jest": "^27.0.7", | ||
"unbuild": "^0.5.13" | ||
}, | ||
"dependencies": { | ||
"find-up": "^5.0", | ||
"bundle-require": "^2.1.8" | ||
}, | ||
"scripts": { | ||
"build": "unbuild", | ||
"dev": "unbuild --stub", | ||
"lint": "eslint \"{src,test}/**/*.ts\"", | ||
"release": "bumpp --commit --push --tag && pnpm publish", | ||
"start": "esno src/index.ts", | ||
"test": "jest" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11433
12
273
2
2
1
+ Addedbundle-require@^2.1.8
+ Addedfind-up@^5.0
+ Added@esbuild/aix-ppc64@0.23.1(transitive)
+ Added@esbuild/android-arm@0.23.1(transitive)
+ Added@esbuild/android-arm64@0.23.1(transitive)
+ Added@esbuild/android-x64@0.23.1(transitive)
+ Added@esbuild/darwin-arm64@0.23.1(transitive)
+ Added@esbuild/darwin-x64@0.23.1(transitive)
+ Added@esbuild/freebsd-arm64@0.23.1(transitive)
+ Added@esbuild/freebsd-x64@0.23.1(transitive)
+ Added@esbuild/linux-arm@0.23.1(transitive)
+ Added@esbuild/linux-arm64@0.23.1(transitive)
+ Added@esbuild/linux-ia32@0.23.1(transitive)
+ Added@esbuild/linux-loong64@0.23.1(transitive)
+ Added@esbuild/linux-mips64el@0.23.1(transitive)
+ Added@esbuild/linux-ppc64@0.23.1(transitive)
+ Added@esbuild/linux-riscv64@0.23.1(transitive)
+ Added@esbuild/linux-s390x@0.23.1(transitive)
+ Added@esbuild/linux-x64@0.23.1(transitive)
+ Added@esbuild/netbsd-x64@0.23.1(transitive)
+ Added@esbuild/openbsd-arm64@0.23.1(transitive)
+ Added@esbuild/openbsd-x64@0.23.1(transitive)
+ Added@esbuild/sunos-x64@0.23.1(transitive)
+ Added@esbuild/win32-arm64@0.23.1(transitive)
+ Added@esbuild/win32-ia32@0.23.1(transitive)
+ Added@esbuild/win32-x64@0.23.1(transitive)
+ Addedbundle-require@2.3.0(transitive)
+ Addedesbuild@0.23.1(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedyocto-queue@0.1.0(transitive)