unplugin-kubb 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nuxt.cjs.map +1 -1
- package/dist/nuxt.js.map +1 -1
- package/dist/src-Dn-CzqNK.js.map +1 -1
- package/dist/src-INEri0Ub.cjs.map +1 -1
- package/dist/webpack-D2VoiCsm.cjs.map +1 -1
- package/dist/webpack-gtaz7qKH.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +2 -4
- package/src/nuxt.ts +1 -2
- package/src/webpack.ts +2 -4
package/dist/nuxt.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt.cjs","names":["vite","webpack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'\nimport '@nuxt/schema'\n\nimport
|
|
1
|
+
{"version":3,"file":"nuxt.cjs","names":["vite","webpack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'\nimport '@nuxt/schema'\n\nimport type { Options } from './types.ts'\nimport vite from './vite.ts'\nimport webpack from './webpack.ts'\n\nexport interface ModuleOptions extends Options {}\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: 'nuxt-unplugin-starter',\n configKey: 'unpluginStarter',\n },\n defaults: undefined,\n setup(options, _nuxt) {\n addVitePlugin(() => vite(options))\n addWebpackPlugin(() => webpack(options))\n\n // ...\n },\n})\n"],"mappings":";;;;;;;;AASA,oDAA+C;CAC7C,MAAM;EACJ,MAAM;EACN,WAAW;EACZ;CACD,UAAU;CACV,MAAM,SAAS,OAAO;AACpB,sCAAoBA,0BAAK,QAAQ,CAAC;AAClC,yCAAuBC,gCAAQ,QAAQ,CAAC;;CAI3C,CAAC"}
|
package/dist/nuxt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt.js","names":["vite","webpack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'\nimport '@nuxt/schema'\n\nimport
|
|
1
|
+
{"version":3,"file":"nuxt.js","names":["vite","webpack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'\nimport '@nuxt/schema'\n\nimport type { Options } from './types.ts'\nimport vite from './vite.ts'\nimport webpack from './webpack.ts'\n\nexport interface ModuleOptions extends Options {}\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: 'nuxt-unplugin-starter',\n configKey: 'unpluginStarter',\n },\n defaults: undefined,\n setup(options, _nuxt) {\n addVitePlugin(() => vite(options))\n addWebpackPlugin(() => webpack(options))\n\n // ...\n },\n})\n"],"mappings":";;;;;;;AASA,mBAAe,iBAAgC;CAC7C,MAAM;EACJ,MAAM;EACN,WAAW;EACZ;CACD,UAAU;CACV,MAAM,SAAS,OAAO;AACpB,sBAAoBA,aAAK,QAAQ,CAAC;AAClC,yBAAuBC,gBAAQ,QAAQ,CAAC;;CAI3C,CAAC"}
|
package/dist/src-Dn-CzqNK.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"src-Dn-CzqNK.js","names":["unpluginFactory: UnpluginFactory<Options | undefined>"],"sources":["../src/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"src-Dn-CzqNK.js","names":["unpluginFactory: UnpluginFactory<Options | undefined>"],"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from '@kubb/core'\nimport { safeBuild } from '@kubb/core'\nimport { createLogger } from '@kubb/core/logger'\nimport type { UnpluginFactory } from 'unplugin'\nimport { createUnplugin } from 'unplugin'\nimport type { Options } from './types.ts'\n\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options) => {\n const name = 'unplugin-kubb' as const\n const logger = createLogger({\n name,\n })\n\n return {\n name,\n enforce: 'pre',\n vite: {\n configResolved(config) {\n logger.on('start', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('success', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('warning', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('error', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n },\n },\n\n async buildStart() {\n if (!options?.config) {\n throw new Error('Config is not set')\n }\n\n const { root: _root, ...userConfig } = options.config as Config\n\n logger.emit('start', 'Building')\n\n const { error } = await safeBuild({\n config: {\n root: process.cwd(),\n ...userConfig,\n output: {\n write: true,\n ...userConfig.output,\n },\n },\n logger,\n })\n\n if (error) {\n throw error\n }\n },\n }\n}\n\nexport const unplugin = /* #__PURE__ */ createUnplugin(unpluginFactory)\n\nexport default unplugin\n"],"mappings":";;;;;AAOA,MAAaA,mBAAyD,YAAY;CAChF,MAAM,OAAO;CACb,MAAM,SAAS,aAAa,EAC1B,MACD,CAAC;AAEF,QAAO;EACL;EACA,SAAS;EACT,MAAM,EACJ,eAAe,QAAQ;AACrB,UAAO,GAAG,UAAU,YAAoB;AACtC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,YAAY,YAAoB;AACxC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,YAAY,YAAoB;AACxC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,UAAU,YAAoB;AACtC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;KAEL;EAED,MAAM,aAAa;AACjB,OAAI,CAAC,SAAS,OACZ,OAAM,IAAI,MAAM,oBAAoB;GAGtC,MAAM,EAAE,MAAM,MAAO,GAAG,eAAe,QAAQ;AAE/C,UAAO,KAAK,SAAS,WAAW;GAEhC,MAAM,EAAE,UAAU,MAAM,UAAU;IAChC,QAAQ;KACN,MAAM,QAAQ,KAAK;KACnB,GAAG;KACH,QAAQ;MACN,OAAO;MACP,GAAG,WAAW;MACf;KACF;IACD;IACD,CAAC;AAEF,OAAI,MACF,OAAM;;EAGX;;AAGH,MAAa,WAA2B,+BAAe,gBAAgB;AAEvE,kBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"src-INEri0Ub.cjs","names":["unpluginFactory: UnpluginFactory<Options | undefined>","unplugin"],"sources":["../src/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"src-INEri0Ub.cjs","names":["unpluginFactory: UnpluginFactory<Options | undefined>","unplugin"],"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from '@kubb/core'\nimport { safeBuild } from '@kubb/core'\nimport { createLogger } from '@kubb/core/logger'\nimport type { UnpluginFactory } from 'unplugin'\nimport { createUnplugin } from 'unplugin'\nimport type { Options } from './types.ts'\n\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options) => {\n const name = 'unplugin-kubb' as const\n const logger = createLogger({\n name,\n })\n\n return {\n name,\n enforce: 'pre',\n vite: {\n configResolved(config) {\n logger.on('start', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('success', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('warning', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n\n logger.on('error', (message: string) => {\n config.logger.info(`${name}: ${message}`)\n })\n },\n },\n\n async buildStart() {\n if (!options?.config) {\n throw new Error('Config is not set')\n }\n\n const { root: _root, ...userConfig } = options.config as Config\n\n logger.emit('start', 'Building')\n\n const { error } = await safeBuild({\n config: {\n root: process.cwd(),\n ...userConfig,\n output: {\n write: true,\n ...userConfig.output,\n },\n },\n logger,\n })\n\n if (error) {\n throw error\n }\n },\n }\n}\n\nexport const unplugin = /* #__PURE__ */ createUnplugin(unpluginFactory)\n\nexport default unplugin\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAaA,mBAAyD,YAAY;CAChF,MAAM,OAAO;CACb,MAAM,8CAAsB,EAC1B,MACD,CAAC;AAEF,QAAO;EACL;EACA,SAAS;EACT,MAAM,EACJ,eAAe,QAAQ;AACrB,UAAO,GAAG,UAAU,YAAoB;AACtC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,YAAY,YAAoB;AACxC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,YAAY,YAAoB;AACxC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;AAEF,UAAO,GAAG,UAAU,YAAoB;AACtC,WAAO,OAAO,KAAK,GAAG,KAAK,IAAI,UAAU;KACzC;KAEL;EAED,MAAM,aAAa;AACjB,OAAI,CAAC,SAAS,OACZ,OAAM,IAAI,MAAM,oBAAoB;GAGtC,MAAM,EAAE,MAAM,MAAO,GAAG,eAAe,QAAQ;AAE/C,UAAO,KAAK,SAAS,WAAW;GAEhC,MAAM,EAAE,UAAU,iCAAgB;IAChC,QAAQ;KACN,MAAM,QAAQ,KAAK;KACnB,GAAG;KACH,QAAQ;MACN,OAAO;MACP,GAAG,WAAW;MACf;KACF;IACD;IACD,CAAC;AAEF,OAAI,MACF,OAAM;;EAGX;;AAGH,MAAaC,aAA2B,6CAAe,gBAAgB;AAEvE,kBAAeA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-D2VoiCsm.cjs","names":["unpluginFactory"],"sources":["../src/webpack.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"webpack-D2VoiCsm.cjs","names":["unpluginFactory"],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginFactoryOutput } from 'unplugin'\nimport { createWebpackPlugin } from 'unplugin'\nimport type { WebpackPluginInstance } from 'webpack'\nimport { unpluginFactory } from './index.ts'\nimport type { Options } from './types.ts'\n\n// resolves issue for: The inferred type of 'default' cannot be named without a reference to 'node_modules/webpack'. This is likely not portable. A type annotation is necessary.\nexport default createWebpackPlugin(unpluginFactory) as unknown as UnpluginFactoryOutput<Options, WebpackPluginInstance>\n"],"mappings":";;;;;AAOA,wDAAmCA,4BAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-gtaz7qKH.js","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"webpack-gtaz7qKH.js","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginFactoryOutput } from 'unplugin'\nimport { createWebpackPlugin } from 'unplugin'\nimport type { WebpackPluginInstance } from 'webpack'\nimport { unpluginFactory } from './index.ts'\nimport type { Options } from './types.ts'\n\n// resolves issue for: The inferred type of 'default' cannot be named without a reference to 'node_modules/webpack'. This is likely not portable. A type annotation is necessary.\nexport default createWebpackPlugin(unpluginFactory) as unknown as UnpluginFactoryOutput<Options, WebpackPluginInstance>\n"],"mappings":";;;;AAOA,sBAAe,oBAAoB,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-kubb",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Unplugin for Kubb",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unplugin",
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@nuxt/kit": "^3.20.0",
|
|
89
89
|
"@nuxt/schema": "^3.20.0",
|
|
90
|
-
"rimraf": "^6.0
|
|
90
|
+
"rimraf": "^6.1.0",
|
|
91
91
|
"rollup": "^4.52.5",
|
|
92
92
|
"vite": "^6.4.1",
|
|
93
93
|
"webpack": "^5.102.1",
|
|
94
|
-
"@kubb/core": "4.
|
|
94
|
+
"@kubb/core": "4.5.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"@kubb/core": "^4.0.0",
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import type { Config } from '@kubb/core'
|
|
1
2
|
import { safeBuild } from '@kubb/core'
|
|
2
3
|
import { createLogger } from '@kubb/core/logger'
|
|
3
|
-
|
|
4
|
-
import { createUnplugin } from 'unplugin'
|
|
5
|
-
|
|
6
|
-
import type { Config } from '@kubb/core'
|
|
7
4
|
import type { UnpluginFactory } from 'unplugin'
|
|
5
|
+
import { createUnplugin } from 'unplugin'
|
|
8
6
|
import type { Options } from './types.ts'
|
|
9
7
|
|
|
10
8
|
export const unpluginFactory: UnpluginFactory<Options | undefined> = (options) => {
|
package/src/nuxt.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'
|
|
2
2
|
import '@nuxt/schema'
|
|
3
3
|
|
|
4
|
+
import type { Options } from './types.ts'
|
|
4
5
|
import vite from './vite.ts'
|
|
5
6
|
import webpack from './webpack.ts'
|
|
6
7
|
|
|
7
|
-
import type { Options } from './types.ts'
|
|
8
|
-
|
|
9
8
|
export interface ModuleOptions extends Options {}
|
|
10
9
|
|
|
11
10
|
export default defineNuxtModule<ModuleOptions>({
|
package/src/webpack.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { createWebpackPlugin } from 'unplugin'
|
|
2
|
-
|
|
3
|
-
import { unpluginFactory } from './index.ts'
|
|
4
|
-
|
|
5
1
|
import type { UnpluginFactoryOutput } from 'unplugin'
|
|
2
|
+
import { createWebpackPlugin } from 'unplugin'
|
|
6
3
|
import type { WebpackPluginInstance } from 'webpack'
|
|
4
|
+
import { unpluginFactory } from './index.ts'
|
|
7
5
|
import type { Options } from './types.ts'
|
|
8
6
|
|
|
9
7
|
// resolves issue for: The inferred type of 'default' cannot be named without a reference to 'node_modules/webpack'. This is likely not portable. A type annotation is necessary.
|