Skip to content

Commit

Permalink
bump to version v1.0.0-beta.0 (#19)
Browse files Browse the repository at this point in the history
[更新] v1.0.0-beta.0
  • Loading branch information
crrashh1542 authored Nov 4, 2023
2 parents ae49bc9 + 4e31710 commit e75e928
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 38 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "win-up-to-date",
"version": "0.11.1",
"version": "1.0.0-beta.0",
"description": "A website project showing the latest status of Windows Insider versions.",
"main": "index.js",
"repository": "https://github.com/crrashh1542/win-up-to-date",
Expand Down
12 changes: 9 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,32 @@ export default {
name: 'App',
components: { Appbar, Foo, Setting, BottomNav },
setup() {
// STEP1 ------ 设置初始值,避免出现 undefined
// STEP1 ------ 设置卡片显示的初始值,避免出现 undefined
let [oriFlightVisibility, oriBranchVisibility] = [true, true]
let data = reactive({
isShowFlight: oriFlightVisibility,
isShowBranch: oriBranchVisibility
})
let [flightVisibility, branchVisibility] = [oriFlightVisibility, oriBranchVisibility]
// 切换显示状态
function setState(emitData) {
// STEP2 ------ 获取子组件传递的信息 和 App 的 data 信息
// STEP2 ------ 获取子组件传递的信息 和 App 的 data 信息,0 是类型,1 是值
let [stateType, stateValue] = [emitData[0], emitData[1]]
let [flightVisibility, branchVisibility] = [oriFlightVisibility, oriBranchVisibility]
// STEP3 ------ 判断类型并改变值
if (stateType === 'isShowFlight') {
flightVisibility = stateValue
} else if (stateType === 'isShowBranch') {
branchVisibility = stateValue
}
// STEP4 ------ 对 data 数据做出替换
data.isShowFlight = flightVisibility
data.isShowBranch = branchVisibility
// console.log('flight ', data.isShowFlight, '\nbranch ', data.isShowBranch)
}
return { ...toRefs(data), setState }
}
Expand Down
6 changes: 3 additions & 3 deletions src/assets/styles/reset.less
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* 此样式表用于基础初始化
* Date: 2023-09-01 / Version: 1.0.1
* Date: 2023-11-05 / Version: 1.1.0
*/

// 引入字体
@import url('https://s.cdn.crrashh.com/prod/font/PingFang-SC-CN/3d9318c6-548c-4982-a591-4a25c3f9d5d4/index.css');
@import url('https://s.cdn.crrashh.com/prod/font/Google-Sans/16a171a7-267e-4e9a-a222-4a1b493ce28a/index.css');
@import url('https://s.cdn.crrashh.com/prod/font/PingFang-SC-CN/e5d34e48-3138-88be-303a-9e8bd2c54ee3/index.css');
@import url('https://s.cdn.crrashh.com/prod/font/Google-Sans/aa7bb3f3-b88d-4f98-3310-83626911a5ba/index.css');
@import url('../fonts/iconfont/iconfont.less');

@import url('./global.less');
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default {
.footer {
--footer-line-height: 1.6;
--footer-margin: .9em 0;
--footer-bottom-spacing: 72px;
--footer-bottom-spacing: 88px;
}
}
Expand Down
14 changes: 2 additions & 12 deletions src/components/Setting.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<script>
// SEC 1 ------ 引入组件和库
import Catalog from './Catalog.vue'
import packageInfo from '/package.json'
import buildInfo from '/temp/buildInfo.json'
import {
provideFluentDesignSystem, fluentDialog, fluentButton, fluentSwitch
} from '@fluentui/web-components'
Expand All @@ -16,8 +13,6 @@ export default {
components: { Catalog },
data() {
return {
packageInfo,
buildInfo,
// 设置初始值,避免出现 undefined
isShowFlight: true,
isShowBranch: true
Expand All @@ -32,14 +27,9 @@ export default {
},
changeStatus(type, state) {
// STEP 1 ------ 将 0 1 对调
if (state === true) {
state = false
} else {
state = true
}
state = !state
// STEP 2 ------ 判断要改变的内容
// 判断要改变的内容
if (type === 0) {
// 如果是 flight
type = 'isShowFlight'
Expand Down
33 changes: 27 additions & 6 deletions src/scripts/parseInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
/**
* 此脚本用于在处理本项目相关信息
* @author crrashh1542
* @version 1.0
* @version 1.1
*/

import packageInfo from '/package.json'
import buildInfo from '/temp/buildInfo.json'

import moment from 'moment'

// packageInfo 相关
const packageVerNum = packageInfo.version // 项目版本号
const packageRepo = packageInfo.repository // 项目地址
Expand All @@ -20,9 +18,32 @@ const buildTime = buildInfo.time // 构建时间
const buildHash = buildInfo.hash // commit hash
const buildNum = buildInfo.build // 构建次数

// 数据处理
const pVersion = 'v' + packageVerNum + '@' + buildHash + ' (build ' + buildNum + ')' // 完整版本
const pTime = moment(buildTime).format('YYYY-MM-DD HH:mm:ss') + ' CST' // 构建时间
// 构建时间处理
const parseBuildTime = t => {
// 由 /temp/buildInfo.js 可知,time 参数格式均为 xxxx-xx-xxTyy:yy+zz:zz
const date = t.slice(0, 10) // 日期
const time = t.slice(11, 19) // 时间
const offset = t.slice(19, 25) // 时区偏移
if(offset === '+08:00') { // 设置时区
return date + ' ' + time + ' CST'
} else {
return date + ' ' + time
}
}

// 项目版本处理
const parseVersion = v => {
// 如果版本带后缀,就不返回 hash,减少移动端视觉占用空间
if(v.indexOf('-') !== -1) {
return 'v' + packageVerNum + ' (build ' + buildNum + ')'
} else {
return 'v' + packageVerNum + '@' + buildHash + ' (build ' + buildNum + ')'
}
}

// 数据合并
const pVersion = parseVersion(packageVerNum) // 完整版本
const pTime = parseBuildTime(buildTime) // 构建时间
const pRepo = packageRepo.split('https://github.com/')[1] // 项目名
const pVue = 'v' + packageDeps['vue'].split('^')[1] // Vue 框架版本
const pUI = 'v' + packageDeps['@fluentui/web-components'].split('^')[1] // 组件库版本
Expand Down
14 changes: 8 additions & 6 deletions src/views/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ import buildInfo from '../scripts/parseInfo'
import Banner from '../components/Banner.vue'
import Card from '../components/Card.vue'
const sources = [
['https://msbuilds.rg-adguard.net', 'MSFT BUFFET DATABASE'],
['https://changewindows.org', 'ChangeWindows'],
['https://bbs.pcbeta.com/viewthread-1941423-1-1.html', '远景论坛 - 2262x(2263x).2506/2552更新包和修复包下载 & 内部版本进度 & .NET CU'],
['https://community.wvbtech.com', 'wvbCommunity']
]
export default {
name: 'ViewAbout',
components: { Banner, Card },
data() {
return {
buildInfo,
sources: [
['https://changewindows.org', 'ChangeWindows'],
['https://bbs.pcbeta.com/viewthread-1941423-1-1.html', '远景论坛 - 2262x(2263x).2506/2552更新包和修复包下载 & 内部版本进度 & .NET CU'],
['https://community.wvbtech.com', 'wvbCommunity']
]
buildInfo, sources
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,19 @@ module.exports = defineConfig({
}
}))

// 打包忽略 moment/locales,避免打包文件体积过大
config.plugin('ignore')
.use(new Webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/, // 要排除的目录
contextRegExp: /moment$/ // 要被处理的目录
}))
// chunk 拆分
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {

// GROUP1 ------ 第三方模块
vendor: {
name: 'vendors',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial'
},

// GROUP2 ------ 项目内组件
commons: {
name: 'common',
Expand All @@ -84,6 +80,7 @@ module.exports = defineConfig({
},
},
})

// GROUP3 ------ 运行时
config.optimization.runtimeChunk({
name: 'runtime'
Expand Down

0 comments on commit e75e928

Please sign in to comment.