Comparing version 1.5.0 to 1.5.1
import { JITI } from 'jiti'; | ||
import { JITIOptions } from 'jiti/dist/types'; | ||
import { DownloadTemplateOptions } from 'giget'; | ||
import { WatchOptions } from 'chokidar'; | ||
@@ -57,2 +58,3 @@ import { diff } from 'ohash'; | ||
meta?: MT; | ||
giget?: DownloadTemplateOptions; | ||
overrides?: T; | ||
@@ -88,2 +90,3 @@ [key: string]: any; | ||
jitiOptions?: JITIOptions; | ||
giget?: DownloadTemplateOptions; | ||
extend?: false | { | ||
@@ -90,0 +93,0 @@ extendKey?: string | string[]; |
{ | ||
"name": "c12", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Smart Config Loader", | ||
@@ -28,3 +28,3 @@ "repository": "unjs/c12", | ||
"prepack": "unbuild", | ||
"release": "changelogen --release && npm publish && git push --follow-tags", | ||
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags", | ||
"test": "pnpm lint && vitest run --coverage && pnpm test:types", | ||
@@ -31,0 +31,0 @@ "test:types": "tsc --noEmit" |
@@ -126,2 +126,6 @@ # ⚙️ c12 | ||
### `giget` | ||
Options passed to [unjs/giget](https://github.com/unjs/giget) when extending layer from git source. | ||
### `envName` | ||
@@ -209,2 +213,35 @@ | ||
## Extending Config Layer from Remote Sources | ||
You can also extend configuration from remote sources such as npm or github. | ||
In the repo, there should be a `config.ts` (or `config.{name}.ts`) file to be considered as a valid config layer. | ||
**Example:** Extend from a github repository | ||
```js | ||
// config.ts | ||
export default { | ||
extends: "gh:repo/owner", | ||
}; | ||
``` | ||
**Example:** Extend from a github repository with branch and subpath | ||
```js | ||
// config.ts | ||
export default { | ||
extends: "gh:repo/owner/theme#dev", | ||
}; | ||
``` | ||
**Example:** Extend with custom configuration ([giget](https://github.com/unjs/giget) options) | ||
```js | ||
// config.ts | ||
export default { | ||
extends: ["gh:repo/owner", { giget: { auth: process.env.GITHUB_TOKEN } }], | ||
}; | ||
``` | ||
## Environment-specific configuration | ||
@@ -211,0 +248,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
51693
913
336