|
| 1 | +import { defineStore } from 'pinia'; |
| 2 | +import packageJson from '../../package.json'; |
| 3 | + |
| 4 | +const dependencies = packageJson.dependencies; |
| 5 | +const packageName = packageJson.name; |
| 6 | + |
| 7 | +const repoBaseUrl = `https://github.com/webdevnerdstuff/${packageName}`; |
| 8 | +const prismVersion = dependencies.prismjs.replace('^', ''); |
| 9 | +const highlightJsVersion = dependencies['highlight.js'].replace('^', ''); |
| 10 | + |
| 11 | + |
| 12 | +const links = { |
| 13 | + changeLog: `${repoBaseUrl}/blob/main/CHANGELOG.md`, |
| 14 | + contribute: `${repoBaseUrl}/tree/main/src/plugin/styles`, |
| 15 | + github: repoBaseUrl, |
| 16 | + githubProfile: 'https://github.com/webdevnerdstuff', |
| 17 | + license: `${repoBaseUrl}/blob/main/LICENSE.md`, |
| 18 | + neonBunnyTheme: 'https://marketplace.visualstudio.com/items?itemName=WebDevNerdStuff.neon-bunny', |
| 19 | + npm: `https://www.npmjs.com/package/${packageName}`, |
| 20 | + uaParser: 'https://www.npmjs.com/package/ua-parser-js', |
| 21 | + vueJs: 'https://vuejs.org/', |
| 22 | +}; |
| 23 | + |
| 24 | +const highlightJsLinks = { |
| 25 | + cdn: `https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@${highlightJsVersion}/build/styles/`, |
| 26 | + homepage: 'https://highlightjs.org/', |
| 27 | + themes: `https://github.com/highlightjs/highlight.js/tree/${highlightJsVersion}/src/styles`, |
| 28 | +}; |
| 29 | + |
| 30 | +const prismLinks = { |
| 31 | + cdn: `https://cdn.jsdelivr.net/gh/PrismJS/prism@${prismVersion}/themes/`, |
| 32 | + homepage: 'https://prismjs.com/', |
| 33 | + prismThemes: `https://github.com/PrismJS/prism/tree/v${prismVersion}/themes`, |
| 34 | + themes: 'https://github.com/PrismJS/prism-themes', |
| 35 | +}; |
| 36 | + |
| 37 | +export const useDataStore = defineStore('data', { |
| 38 | + state: () => ({ |
| 39 | + highlightJsLinks, |
| 40 | + links, |
| 41 | + package: packageJson, |
| 42 | + prismLinks, |
| 43 | + }), |
| 44 | +}); |
0 commit comments