Skip to content

fix: repoBaseUrl contains unexpected scope name #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
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 src/documentation/sections/LicenseSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<br />
Licensed under the
<a
:href="`${links.repo}/blob/master/LICENSE.md`"
:href="`${links.github}/blob/main/LICENSE.md`"
target="_blank"
>
MIT License
Expand Down
20 changes: 10 additions & 10 deletions src/stores/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import packageJson from '@root/package.json';


export const useCoreStore = defineStore('core', () => {
const packageName = packageJson.name;
const storageName = 'vuetify-inline-fields';
const scopedPackageName = packageJson.name;
const packageName = scopedPackageName.split('/')[1];

// Links //
const repoBaseUrl = `https://github.com/webdevnerdstuff/${packageName}`;
Expand All @@ -14,7 +14,7 @@ export const useCoreStore = defineStore('core', () => {
github: repoBaseUrl,
githubProfile: 'https://github.com/webdevnerdstuff',
license: `${repoBaseUrl}/blob/main/LICENSE.md`,
npm: `https://www.npmjs.com/package/${packageName}`,
npm: `https://www.npmjs.com/package/${scopedPackageName}`,
vue: 'https://vuejs.org/',
vueUse: 'https://vueuse.org/',
vuetify: 'https://vuetifyjs.com/',
Expand All @@ -23,29 +23,29 @@ export const useCoreStore = defineStore('core', () => {

const actions = {
setLocalStorage(val: string): string {
const oldValue = localStorage.getItem(storageName);
const oldValue = localStorage.getItem(packageName);
const newValue = val ?? oldValue;

localStorage.setItem(storageName, newValue);
localStorage.setItem(packageName, newValue);
return newValue;
},
setTheme(val: string): string {
const themeName = val === 'dark' ? 'light' : 'dark';
const currentTheme = localStorage.getItem(`${storageName}-theme`);
const currentTheme = localStorage.getItem(`${packageName}-theme`);
const newTheme = themeName ?? currentTheme;

localStorage.setItem(`${storageName}-theme`, newTheme);
localStorage.setItem(`${packageName}-theme`, newTheme);
return newTheme;
},
};

const getters = {
getLocalStorage: () => (): unknown => {
const value = localStorage.getItem(storageName);
const value = localStorage.getItem(packageName);
return value;
},
getTheme: () => {
const value = localStorage.getItem(`${storageName}-theme`);
const value = localStorage.getItem(`${packageName}-theme`);
return value;
},
};
Expand All @@ -55,7 +55,7 @@ export const useCoreStore = defineStore('core', () => {
...getters,
links,
package: packageJson,
packageName,
pluginVersion: packageJson.version,
storageName,
};
});