@gradin/vue-utils 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/footer-year.js +1 -2
- package/dist/resetable-reactive.js +1 -1
- package/dist/when-route-change.js +1 -1
- package/package.json +8 -7
- /package/dist/{types/footer-year.d.ts → footer-year.d.ts} +0 -0
- /package/dist/{types/index.d.ts → index.d.ts} +0 -0
- /package/dist/{types/resetable-reactive.d.ts → resetable-reactive.d.ts} +0 -0
- /package/dist/{types/when-route-change.d.ts → when-route-change.d.ts} +0 -0
package/dist/footer-year.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
var _a, _b;
|
|
2
1
|
export const currentYear = new Date().getFullYear();
|
|
3
|
-
export const releaseYear = Number((
|
|
2
|
+
export const releaseYear = Number((import.meta.env?.VITE_APP_RELEASE_YEAR) ?? 0) || currentYear;
|
|
4
3
|
export const footerYear = releaseYear === currentYear ? `${currentYear}` : `${releaseYear}-${currentYear}`;
|
|
5
4
|
export const yearsSinceRelease = currentYear - releaseYear > 0
|
|
6
5
|
? Array.from({ length: currentYear - releaseYear + 1 }, (_, i) => currentYear - i)
|
|
@@ -9,7 +9,7 @@ export const whenRouteChange = (callback, watchSource) => {
|
|
|
9
9
|
const route = useRoute();
|
|
10
10
|
const routeName = route.name; // cache route name
|
|
11
11
|
const watchRouteParamsAndQuery = () => JSON.stringify([route.query, route.params]);
|
|
12
|
-
watch(watchSource
|
|
12
|
+
watch(watchSource ?? watchRouteParamsAndQuery, () => {
|
|
13
13
|
if (route.name === routeName) {
|
|
14
14
|
callback();
|
|
15
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradin/vue-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Useful utilities for Vue projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsc",
|
|
10
10
|
"lint": "eslint . --fix",
|
|
11
|
-
"
|
|
11
|
+
"preversion": "npm run build",
|
|
12
|
+
"publish": "np"
|
|
12
13
|
},
|
|
13
14
|
"files": [
|
|
14
15
|
"dist"
|
|
@@ -35,16 +36,16 @@
|
|
|
35
36
|
},
|
|
36
37
|
"homepage": "https://github.com/gradints/vue-utils#readme",
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"vue": "^3.5.
|
|
39
|
+
"vue": "^3.5.40"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@eslint/js": "^10.0.1",
|
|
42
43
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
43
|
-
"eslint-plugin-simple-import-sort": "^
|
|
44
|
-
"typescript": "^
|
|
45
|
-
"typescript-eslint": "^8.
|
|
44
|
+
"eslint-plugin-simple-import-sort": "^14.0.0",
|
|
45
|
+
"typescript": "^6.0.3",
|
|
46
|
+
"typescript-eslint": "^8.65.0"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
|
-
"vue-router": "^4.6.3 || ^5.
|
|
49
|
+
"vue-router": "^4.6.3 || ^5.2.0"
|
|
49
50
|
}
|
|
50
51
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|