Skip to content

Commit

Permalink
fixing nuxt module build error
Browse files Browse the repository at this point in the history
  • Loading branch information
stephiescastle committed Jun 11, 2024
1 parent a50b9be commit 90605ab
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/common-storybook/src/config/withGlobals.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect, useGlobals } from '@storybook/preview-api'
import { useThemeStore, type Explorer1Theme } from '@explorer-1/vue/src/store/theme'
import { useThemeStore } from '@explorer-1/vue/src/store/theme'
import { type Explorer1Theme } from '@explorer-1/vue/src/interfaces'

const getConfig = (config) => {
// default values
Expand Down
5 changes: 5 additions & 0 deletions packages/nuxt/dist/module.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = function(...args) {
return import('./module.mjs').then(m => m.default.call(this, ...args))
}
const _meta = module.exports.meta = require('./module.json')
module.exports.getMeta = () => Promise.resolve(_meta)
13 changes: 13 additions & 0 deletions packages/nuxt/dist/module.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as _nuxt_schema from '@nuxt/schema';

type Explorer1Theme = 'defaultTheme' | 'ThemeInternal' | 'ThemeEdu';
interface ModuleOptions {
theme: Explorer1Theme;
includeStyles: boolean;
includeComponents: boolean;
includePageTemplates: boolean;
includeStore: boolean;
}
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;

export { type ModuleOptions, _default as default };
13 changes: 13 additions & 0 deletions packages/nuxt/dist/module.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as _nuxt_schema from '@nuxt/schema';

type Explorer1Theme = 'defaultTheme' | 'ThemeInternal' | 'ThemeEdu';
interface ModuleOptions {
theme: Explorer1Theme;
includeStyles: boolean;
includeComponents: boolean;
includePageTemplates: boolean;
includeStore: boolean;
}
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;

export { type ModuleOptions, _default as default };
9 changes: 9 additions & 0 deletions packages/nuxt/dist/module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@explorer-1/nuxt",
"configKey": "explorer1",
"version": "0.0.0",
"builder": {
"@nuxt/module-builder": "0.7.0",
"unbuild": "2.0.0"
}
}
16 changes: 16 additions & 0 deletions packages/nuxt/dist/types.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

import type { ModuleOptions } from './module.js'


declare module '@nuxt/schema' {
interface NuxtConfig { ['explorer1']?: Partial<ModuleOptions> }
interface NuxtOptions { ['explorer1']?: ModuleOptions }
}

declare module 'nuxt/schema' {
interface NuxtConfig { ['explorer1']?: Partial<ModuleOptions> }
interface NuxtOptions { ['explorer1']?: ModuleOptions }
}


export type { ModuleOptions, default } from './module.js'
16 changes: 16 additions & 0 deletions packages/nuxt/dist/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

import type { ModuleOptions } from './module'


declare module '@nuxt/schema' {
interface NuxtConfig { ['explorer1']?: Partial<ModuleOptions> }
interface NuxtOptions { ['explorer1']?: ModuleOptions }
}

declare module 'nuxt/schema' {
interface NuxtConfig { ['explorer1']?: Partial<ModuleOptions> }
interface NuxtOptions { ['explorer1']?: ModuleOptions }
}


export type { ModuleOptions, default } from './module'
4 changes: 3 additions & 1 deletion packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {
installModule,
createResolver
} from '@nuxt/kit'
import { type Explorer1Theme } from '@explorer-1/vue/src/store/theme'

// TODO: Note: importing this type from elsewhere (such as @explorer-1/vue/src/interfaces) breaks the module build
type Explorer1Theme = 'defaultTheme' | 'ThemeInternal' | 'ThemeEdu'

export interface ModuleOptions {
theme: Explorer1Theme
Expand Down
3 changes: 2 additions & 1 deletion packages/nuxt/src/runtime/plugins/set-theme-default.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useThemeStore, type Explorer1Theme } from '@explorer-1/vue/src/store/theme'
import { useThemeStore } from '@explorer-1/vue/src/store/theme'
import { type Explorer1Theme } from '@explorer-1/vue/src/interfaces'
import { defineNuxtPlugin } from 'nuxt/app'

export default defineNuxtPlugin((nuxtApp) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/dist/explorer-1-vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ const ne = Pe("header", {
}
});
/*!
* vue-router v4.3.3
* vue-router v4.3.2
* (c) 2024 Eduardo San Martin Morote
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/dist/explorer-1-vue.umd.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/vue/dist/src/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ export interface PageResponse {
body?: Partial<BlockData>[];
breadcrumb?: string;
}
export type Explorer1Theme = 'defaultTheme' | 'ThemeInternal' | 'ThemeEdu';
3 changes: 2 additions & 1 deletion packages/vue/dist/src/store/theme.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Explorer1Theme } from './../interfaces';

/** Sets the Explorer-1 theme
*/
export type Explorer1Theme = 'defaultTheme' | 'ThemeInternal' | 'ThemeEdu';
export interface State {
theme: Explorer1Theme | null;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/vue/lib/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// utils
import dayjs from './../src/utils/dayjs'
import filters from './../src/utils/filters'
import type { Explorer1Theme } from '../src/interfaces'

// stores
import { useHeaderStore } from './../src/store/header'
Expand Down Expand Up @@ -40,6 +41,7 @@ import MixinAnimationCaret from './../src/components/MixinAnimationCaret/MixinAn
import MixinFancybox from './../src/components/MixinFancybox/MixinFancybox.vue'

export {
type Explorer1Theme,
dayjs,
filters,
useHeaderStore,
Expand Down
2 changes: 2 additions & 0 deletions packages/vue/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,5 @@ export interface PageResponse {
body?: Partial<BlockData>[]
breadcrumb?: string
}

export type Explorer1Theme = 'defaultTheme' | 'ThemeInternal' | 'ThemeEdu'
3 changes: 1 addition & 2 deletions packages/vue/src/store/theme.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { defineStore } from 'pinia'
import { type Explorer1Theme } from './../interfaces'

/** Sets the Explorer-1 theme
*/

export type Explorer1Theme = 'defaultTheme' | 'ThemeInternal' | 'ThemeEdu'

export interface State {
theme: Explorer1Theme | null
}
Expand Down

0 comments on commit 90605ab

Please sign in to comment.