-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change naming of install methode and make options required
- Loading branch information
1 parent
1685120
commit 2c24839
Showing
6 changed files
with
23 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'vue-craftcms': patch | ||
--- | ||
|
||
Change type of Change naming of install methode from CraftSdk to CraftCms and make all Packe Options required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { inject } from 'vue'; | ||
import type { CraftSdkOptions } from '../types'; | ||
import type { CraftCmsOptions } from '../types'; | ||
|
||
export function useCraft(): CraftSdkOptions { | ||
return inject<CraftSdkOptions>('CraftSdkOptions')!; | ||
export function useCraft(): CraftCmsOptions { | ||
return inject<CraftCmsOptions>('CraftCmsOptions')!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import CraftPage from './components/CraftPage.vue'; | ||
import CraftArea from './components/CraftArea.vue'; | ||
import type { App } from 'vue'; | ||
import type { CraftSdkOptions } from './types'; | ||
import type { CraftCmsOptions } from './types'; | ||
|
||
export * from './composables/useCraftUrlBuilder'; | ||
export * from './composables/useApi'; | ||
export * from './types'; | ||
|
||
export const defaultOptions: CraftSdkOptions = { | ||
baseUrl: 'default.com', | ||
export const defaultOptions: CraftCmsOptions = { | ||
baseUrl: '', | ||
registerComponents: true, | ||
debug: false, | ||
}; | ||
|
||
export const CraftSdk = { | ||
install(app: App, options: CraftSdkOptions = defaultOptions) { | ||
export const CraftCms = { | ||
install(app: App, options: CraftCmsOptions = defaultOptions) { | ||
if (options.registerComponents) { | ||
app.component('CraftPage', CraftPage); | ||
app.component('CraftArea', CraftArea); | ||
} | ||
|
||
app.provide('CraftSdkOptions', options); | ||
app.provide('CraftCmsOptions', options); | ||
|
||
if (options.debug) { | ||
console.log('Craft SDK Options:', options); | ||
console.log('Craft CMS Options', options); | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters