Skip to content
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

Feat/build info #2

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const config: ApiDocsBlock[] = [
'guide.forCoreContributors.smallIssues',
'guide.forCoreContributors.singlePrPerIssue',
'guide.forCoreContributors.onePersonPerIssue',
'guide.forCoreContributors.checkBuildInfo',
'guide.forCoreContributors.checkYourCode',
'guide.forCoreContributors.weUseYarn',
'guide.forCoreContributors.beProactive',
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/locales/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3006,6 +3006,7 @@
"singlePrPerIssue": "Create a single PR for one issue. If we have several PRs - move all the code into a single PR and close the rest. If one PR covers several issues - either split it in several PRs or mark one of the issues as duplicate.",
"onePersonPerIssue": "Make sure to assign an issue to only a single person.",
"checkYourCode": "Check your code: [conventions](https://github.com/epicmaxco/vuestic-ui/blob/master/packages/docs/conventions.md)[[target=_blank]].",
"checkBuildInfo": "Check the console log to see build information.",
"weUseYarn": "We use [yarn](https://yarnpkg.com/lang/en/)[[target=_blank]] for package management.",
"beProactive": "Be proactive. If you think something is wrong - create an issue or discuss.",
"recommendedTools": "Recommended tools: [GitKraken](https://www.gitkraken.com/)[[target=_blank]], [WebStorm](https://www.jetbrains.com/webstorm/)[[target=_blank]], [ShareX](https://getsharex.com/)[[target=_blank]].",
Expand Down
3 changes: 2 additions & 1 deletion packages/docs/src/locales/ru/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -2987,8 +2987,9 @@
"singlePrPerIssue": "Создавайте один PR для одной проблемы. Если у нас несколько PR - переместите весь код в один, а остальные закройте. Если один PR охватывает несколько вопросов - либо разделите его на несколько PR, либо отметьте одну из проблем как повторяющуюся.",
"onePersonPerIssue": "Убедитесь, что на каждую проблему назначен только один человек.",
"checkYourCode": "Проверьте свой код: [соглашения](https://github.com/epicmaxco/vuestic-ui/blob/master/packages/docs/conventions.md)[[target=_blank]].",
"checkBuildInfo": "Посмотреть информацию о сборке можно в консоли.",
"weUseYarn": "Мы используем [yarn](https://yarnpkg.com/lang/en/)[[target=_blank]] для управления пакетами.",
"beProactive": "Будьте инициативными. Если вы считаете, что что-то не так - создайте вопрос (issue) или обсужденеи (discuss).",
"beProactive": "Будьте инициативными. Если вы считаете, что что-то не так - создайте вопрос (issue) или обсуждение (discuss).",
"recommendedTools": "Рекомендуемые инструменты: [GitKraken](https://www.gitkraken.com/)[[target=_blank]], [WebStorm](https://www.jetbrains.com/webstorm/)[[target=_blank]], [ShareX](https://getsharex.com/)[[target=_blank]].",
"workInBook": "Если вы работаете над UI компонентами - работайте в book environment (`yarn serve:book`). Мы хотим исключить глобальные материалы из компонентов."
},
Expand Down
3 changes: 3 additions & 0 deletions packages/docs/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { VuesticConfig } from './config/vuestic-config'
import { useGtag } from './services/gtag'
import { useTranslateIfExists } from './locales/translateIfExistsPlugin'
import { useMeta } from './services/vue-meta'
import { showBuildInfo } from '@/utilities/utils'

showBuildInfo()

const app = createApp(App)

Expand Down
3 changes: 3 additions & 0 deletions packages/docs/src/types/version.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const VERSION: string
declare const TIMESTAMP: string
declare const COMMIT: string
8 changes: 8 additions & 0 deletions packages/docs/src/utilities/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ export const readComponent = async (fileName: string): Promise<any> => {
/* webpackMode: "lazy-once" */
`../examples/${fileName}.vue`)
}

export const showBuildInfo = () => {
console.group('Build info:')
console.log(`Vuestic UI: v${VERSION}`)
console.log(`Date: ${TIMESTAMP}`)
console.log(`Commit: ${COMMIT}`)
console.groupEnd()
}
11 changes: 11 additions & 0 deletions packages/docs/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const getLastCommitHash = () => {
const hash = require('child_process').execSync('git rev-parse HEAD').toString()
return hash.slice(0, 6)
}
const path = require('path')

function resolve (dir) {
Expand All @@ -14,6 +18,13 @@ module.exports = {
})
},
configureWebpack: {
plugins: [
new (require('webpack')).DefinePlugin({
VERSION: JSON.stringify(require('../ui/package.json').version),
TIMESTAMP: JSON.stringify(new Date().toUTCString()),
COMMIT: JSON.stringify(getLastCommitHash()),
}),
],
entry: {
app: resolve('./src/main.ts'),
},
Expand Down