Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

feat: allow extending with theme config #7131

Merged
merged 3 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@nuxt/schema": "3.0.0-rc.8",
"c12": "^0.2.9",
"c12": "^0.2.10",
"consola": "^2.15.3",
"defu": "^6.1.0",
"globby": "^13.1.2",
Expand Down
1 change: 1 addition & 0 deletions packages/kit/src/loader/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export async function loadNuxtConfig (opts: LoadNuxtConfigOptions): Promise<Nuxt
name: 'nuxt',
configFile: 'nuxt.config',
rcFile: '.nuxtrc',
extend: { extendKey: ['theme', 'extends'] },
dotenv: true,
globalRc: true,
...opts
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@types/flat": "^5.0.2",
"@types/mri": "^1.1.1",
"@types/semver": "^7",
"c12": "^0.2.9",
"c12": "^0.2.10",
"chokidar": "^3.5.3",
"clear": "^0.1.0",
"clipboardy": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"vite": "~3.0.9"
},
"dependencies": {
"c12": "^0.2.9",
"c12": "^0.2.10",
"create-require": "^1.1.1",
"defu": "^6.1.0",
"jiti": "^1.14.0",
Expand Down
15 changes: 14 additions & 1 deletion packages/schema/src/config/_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { defineUntypedSchema } from 'untyped'

export default defineUntypedSchema({
/**
* Extend nested configurations from multiple local or remote sources.
* Extend project from multiple local or remote sources.
*
* Value should be either a string or array of strings pointing to source directories or config path relative to current config.
*
Expand All @@ -23,6 +23,19 @@ export default defineUntypedSchema({
*/
extends: null,

/**
* Extend project from a local or remote source.
*
* Value should be a string pointing to source directory or config path relative to current config.
*
* You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository.
*
* @type {string}
*
* @version 3
*/
theme: null,

/**
* Define the workspace directory of your application.
*
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/basic/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default defineNuxtConfig({
},
buildDir: process.env.NITRO_BUILD_DIR,
builder: process.env.TEST_WITH_WEBPACK ? 'webpack' : 'vite',
theme: './extends/bar',
extends: [
'./extends/bar',
'./extends/node_modules/foo'
],
nitro: {
Expand Down
23 changes: 19 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ __metadata:
"@nuxt/schema": 3.0.0-rc.8
"@types/lodash.template": ^4
"@types/semver": ^7
c12: ^0.2.9
c12: ^0.2.10
consola: ^2.15.3
defu: ^6.1.0
globby: ^13.1.2
Expand Down Expand Up @@ -1684,7 +1684,7 @@ __metadata:
dependencies:
"@types/lodash.template": ^4
"@types/semver": ^7
c12: ^0.2.9
c12: ^0.2.10
create-require: ^1.1.1
defu: ^6.1.0
jiti: ^1.14.0
Expand Down Expand Up @@ -4063,6 +4063,21 @@ __metadata:
languageName: node
linkType: hard

"c12@npm:^0.2.10":
version: 0.2.10
resolution: "c12@npm:0.2.10"
dependencies:
defu: ^6.0.0
dotenv: ^16.0.1
gittar: ^0.1.1
jiti: ^1.14.0
mlly: ^0.5.11
pathe: ^0.3.4
rc9: ^1.2.2
checksum: 5c8f83a2a10717dd428d1c81801b5771694d6f2b381fda955d159d5e7943b7c958953764edab92033c84186c1d8444cbc0db10e771222b58c2ccbcff2a6c1eba
languageName: node
linkType: hard

"c12@npm:^0.2.7, c12@npm:^0.2.9":
version: 0.2.9
resolution: "c12@npm:0.2.9"
Expand Down Expand Up @@ -9392,7 +9407,7 @@ __metadata:
languageName: node
linkType: hard

"mlly@npm:^0.5.12, mlly@npm:^0.5.13, mlly@npm:^0.5.14, mlly@npm:^0.5.2, mlly@npm:^0.5.7":
"mlly@npm:^0.5.11, mlly@npm:^0.5.12, mlly@npm:^0.5.13, mlly@npm:^0.5.14, mlly@npm:^0.5.2, mlly@npm:^0.5.7":
version: 0.5.14
resolution: "mlly@npm:0.5.14"
dependencies:
Expand Down Expand Up @@ -9921,7 +9936,7 @@ __metadata:
"@types/flat": ^5.0.2
"@types/mri": ^1.1.1
"@types/semver": ^7
c12: ^0.2.9
c12: ^0.2.10
chokidar: ^3.5.3
clear: ^0.1.0
clipboardy: ^3.0.0
Expand Down