Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
nuxt-config-schema
Advanced tools
This is a proof of concept module for a feature in Nuxt 3 that automatically infers and generates schema based on user provided configuration from several sources using [unjs/untyped](https://github.com/unjs/untyped) and supports extending layers.
This is a proof of concept module for a feature in Nuxt 3 that automatically infers and generates schema based on user provided configuration from several sources using unjs/untyped and supports extending layers.
Schema can be defined in nuxt.schema.ts
or $schema
field in nuxt.config.ts
.
Read the proposal for Nuxt 3
This experiment is landed to Nuxt 3 core since 3.1.0 (https://github.com/nuxt/nuxt/pull/18410)
nuxt-config-schema
as dev dependency:# npm
npm i -D nuxt-config-schema
# pnpm
pnpm add -D nuxt-config-schema
# yarn
yarn add nuxt-config-schema
nuxt.config
:export default defineNuxtConfig({
modules: ['nuxt-config-schema'],
})
nuxt.schema.ts
:export default defineNuxtConfigSchema({
appConfig: {
test2: {
$default: 'from nuxt.schema',
},
},
/** Config schema for another integration */
anotherConfig: {
aTest: '123',
},
})
nuxi dev
or nuxi build
commandsYou can access generated schema (json, markdown and types) from .nuxt/schema/
directory and also hooks below:
schema:extend(schemaDefs)
: Extend schema defenitions (first call after modules:done
hook)schema:resolved(schema)
: Extend resolved schema after merging (first call after modules:done
hook)schema:beforeWrite(schema)
: Extend resolved schema just before writing to filesystem (called after build:done
hook)schema:written
: Hook will be called when schema has been written and updated to filesystemnpm run dev:prepare
to generate type stubs.npm run dev
to start playground in development mode.FAQs
This is a proof of concept module for a feature in Nuxt 3 that automatically infers and generates schema based on user provided configuration from several sources using [unjs/untyped](https://github.com/unjs/untyped) and supports extending layers.
The npm package nuxt-config-schema receives a total of 3,431 weekly downloads. As such, nuxt-config-schema popularity was classified as popular.
We found that nuxt-config-schema demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.