@logto/vue 0.1.8
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/LICENSE +21 -0
- package/lib/consts.d.ts +2 -0
- package/lib/consts.js +5 -0
- package/lib/context.d.ts +14 -0
- package/lib/context.js +41 -0
- package/lib/index.d.ts +79 -0
- package/lib/index.js +110 -0
- package/lib/plugin.d.ts +16 -0
- package/lib/plugin.js +105 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Silverhand
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/lib/consts.d.ts
ADDED
package/lib/consts.js
ADDED
package/lib/context.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import LogtoClient from '@logto/browser';
|
|
2
|
+
import { ComputedRef, Ref, UnwrapRef } from 'vue';
|
|
3
|
+
export declare type Context = {
|
|
4
|
+
logtoClient: Ref<UnwrapRef<LogtoClient | undefined>>;
|
|
5
|
+
isAuthenticated: Ref<boolean>;
|
|
6
|
+
loadingCount: Ref<number>;
|
|
7
|
+
error: Ref<Error | undefined>;
|
|
8
|
+
isLoading: ComputedRef<boolean>;
|
|
9
|
+
setError: (error: unknown, fallbackErrorMessage?: string | undefined) => void;
|
|
10
|
+
setIsAuthenticated: (isAuthenticated: boolean) => void;
|
|
11
|
+
setLoading: (isLoading: boolean) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const createContext: (client: LogtoClient) => Context;
|
|
14
|
+
export declare const throwContextError: () => never;
|
package/lib/context.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.throwContextError = exports.createContext = void 0;
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
const createContext = (client) => {
|
|
6
|
+
const context = (0, vue_1.toRefs)((0, vue_1.reactive)({
|
|
7
|
+
logtoClient: client,
|
|
8
|
+
isAuthenticated: client.isAuthenticated,
|
|
9
|
+
loadingCount: 0,
|
|
10
|
+
error: undefined,
|
|
11
|
+
}));
|
|
12
|
+
const { isAuthenticated, loadingCount, error } = context;
|
|
13
|
+
const isLoading = (0, vue_1.computed)(() => loadingCount.value > 0);
|
|
14
|
+
/* eslint-disable @silverhand/fp/no-mutation */
|
|
15
|
+
const setError = (_error, fallbackErrorMessage) => {
|
|
16
|
+
if (_error instanceof Error) {
|
|
17
|
+
error.value = _error;
|
|
18
|
+
}
|
|
19
|
+
else if (fallbackErrorMessage) {
|
|
20
|
+
error.value = new Error(fallbackErrorMessage);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const setLoading = (isLoading) => {
|
|
24
|
+
if (isLoading) {
|
|
25
|
+
loadingCount.value += 1;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
loadingCount.value = Math.max(0, loadingCount.value - 1);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const setIsAuthenticated = (_isAuthenticated) => {
|
|
32
|
+
isAuthenticated.value = _isAuthenticated;
|
|
33
|
+
};
|
|
34
|
+
/* eslint-enable @silverhand/fp/no-mutation */
|
|
35
|
+
return { ...context, isLoading, setError, setLoading, setIsAuthenticated };
|
|
36
|
+
};
|
|
37
|
+
exports.createContext = createContext;
|
|
38
|
+
const throwContextError = () => {
|
|
39
|
+
throw new Error('Must install Logto plugin first.');
|
|
40
|
+
};
|
|
41
|
+
exports.throwContextError = throwContextError;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { IdTokenClaims, LogtoConfig, UserInfoResponse } from '@logto/browser';
|
|
2
|
+
import { App, Ref } from 'vue';
|
|
3
|
+
export type { LogtoConfig, IdTokenClaims, UserInfoResponse, LogtoClientError, LogtoClientErrorCode, } from '@logto/browser';
|
|
4
|
+
declare type LogtoVuePlugin = {
|
|
5
|
+
install: (app: App, config: LogtoConfig) => void;
|
|
6
|
+
};
|
|
7
|
+
declare type Logto = {
|
|
8
|
+
isAuthenticated: Readonly<Ref<boolean>>;
|
|
9
|
+
isLoading: Readonly<Ref<boolean>>;
|
|
10
|
+
error: Readonly<Ref<Error | undefined>>;
|
|
11
|
+
fetchUserInfo: () => Promise<UserInfoResponse | undefined>;
|
|
12
|
+
getAccessToken: (resource?: string) => Promise<string | undefined>;
|
|
13
|
+
getIdTokenClaims: () => IdTokenClaims | undefined;
|
|
14
|
+
signIn: (redirectUri: string) => Promise<void>;
|
|
15
|
+
signOut: (postLogoutRedirectUri: string) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Creates the Logto Vue plugin
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { createApp } from 'vue';
|
|
22
|
+
* import { createLogto } from '@logto/vue';
|
|
23
|
+
*
|
|
24
|
+
* const app = createApp(App);
|
|
25
|
+
* const app.use(createLogto, {
|
|
26
|
+
* appId: '<your-app-id>',
|
|
27
|
+
* endpoint: '<your-oidc-endpoint-domain>',
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* app.mount('#app');
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* Use this in your Vue root component to register the plugin
|
|
34
|
+
*/
|
|
35
|
+
export declare const createLogto: LogtoVuePlugin;
|
|
36
|
+
/**
|
|
37
|
+
* A Vue composable method that provides the Logto reactive refs and auth methods.
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { useLogto } from '@logto/vue';
|
|
41
|
+
*
|
|
42
|
+
* export default {
|
|
43
|
+
* setup() {
|
|
44
|
+
* const { isAuthenticated, signIn } = useLogto();
|
|
45
|
+
*
|
|
46
|
+
* return {
|
|
47
|
+
* isAuthenticated,
|
|
48
|
+
* onClickSignIn: () => {
|
|
49
|
+
* signIn('<your-redirect-uri>');
|
|
50
|
+
* },
|
|
51
|
+
* }
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* Use this composable in the setup script of your Vue component to make sure the injection works
|
|
57
|
+
*/
|
|
58
|
+
export declare const useLogto: () => Logto;
|
|
59
|
+
/**
|
|
60
|
+
* A Vue composable method that watches browser navigation and automatically handles the sign-in callback
|
|
61
|
+
*
|
|
62
|
+
* ```ts
|
|
63
|
+
* import { useLogto } from '@logto/vue';
|
|
64
|
+
* import { useHandleSignInCallback } from '@logto/vue';
|
|
65
|
+
*
|
|
66
|
+
* export default {
|
|
67
|
+
* setup() {
|
|
68
|
+
* useHandleSignInCallback();
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* Use this in the setup script of your Callback page to make sure the injection works
|
|
74
|
+
*/
|
|
75
|
+
export declare const useHandleSignInCallback: (returnToPageUrl?: string) => {
|
|
76
|
+
isLoading: Readonly<Ref<boolean>>;
|
|
77
|
+
isAuthenticated: Readonly<Ref<boolean>>;
|
|
78
|
+
error: Readonly<Ref<Error | undefined>>;
|
|
79
|
+
};
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useHandleSignInCallback = exports.useLogto = exports.createLogto = void 0;
|
|
7
|
+
const browser_1 = __importDefault(require("@logto/browser"));
|
|
8
|
+
const vue_1 = require("vue");
|
|
9
|
+
const consts_1 = require("./consts");
|
|
10
|
+
const context_1 = require("./context");
|
|
11
|
+
const plugin_1 = require("./plugin");
|
|
12
|
+
/**
|
|
13
|
+
* Creates the Logto Vue plugin
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { createApp } from 'vue';
|
|
17
|
+
* import { createLogto } from '@logto/vue';
|
|
18
|
+
*
|
|
19
|
+
* const app = createApp(App);
|
|
20
|
+
* const app.use(createLogto, {
|
|
21
|
+
* appId: '<your-app-id>',
|
|
22
|
+
* endpoint: '<your-oidc-endpoint-domain>',
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* app.mount('#app');
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* Use this in your Vue root component to register the plugin
|
|
29
|
+
*/
|
|
30
|
+
exports.createLogto = {
|
|
31
|
+
install(app, config) {
|
|
32
|
+
const client = new browser_1.default(config);
|
|
33
|
+
const context = (0, context_1.createContext)(client);
|
|
34
|
+
const pluginMethods = (0, plugin_1.createPluginMethods)(context);
|
|
35
|
+
const { isAuthenticated, isLoading, error } = context;
|
|
36
|
+
app.provide(consts_1.contextInjectionKey, context);
|
|
37
|
+
app.provide(consts_1.logtoInjectionKey, {
|
|
38
|
+
isAuthenticated: (0, vue_1.readonly)(isAuthenticated),
|
|
39
|
+
isLoading: (0, vue_1.readonly)(isLoading),
|
|
40
|
+
error: (0, vue_1.readonly)(error),
|
|
41
|
+
...pluginMethods,
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* A Vue composable method that provides the Logto reactive refs and auth methods.
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { useLogto } from '@logto/vue';
|
|
50
|
+
*
|
|
51
|
+
* export default {
|
|
52
|
+
* setup() {
|
|
53
|
+
* const { isAuthenticated, signIn } = useLogto();
|
|
54
|
+
*
|
|
55
|
+
* return {
|
|
56
|
+
* isAuthenticated,
|
|
57
|
+
* onClickSignIn: () => {
|
|
58
|
+
* signIn('<your-redirect-uri>');
|
|
59
|
+
* },
|
|
60
|
+
* }
|
|
61
|
+
* }
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* Use this composable in the setup script of your Vue component to make sure the injection works
|
|
66
|
+
*/
|
|
67
|
+
const useLogto = () => {
|
|
68
|
+
const logto = (0, vue_1.inject)(consts_1.logtoInjectionKey);
|
|
69
|
+
if (!logto) {
|
|
70
|
+
return (0, context_1.throwContextError)();
|
|
71
|
+
}
|
|
72
|
+
return logto;
|
|
73
|
+
};
|
|
74
|
+
exports.useLogto = useLogto;
|
|
75
|
+
/**
|
|
76
|
+
* A Vue composable method that watches browser navigation and automatically handles the sign-in callback
|
|
77
|
+
*
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { useLogto } from '@logto/vue';
|
|
80
|
+
* import { useHandleSignInCallback } from '@logto/vue';
|
|
81
|
+
*
|
|
82
|
+
* export default {
|
|
83
|
+
* setup() {
|
|
84
|
+
* useHandleSignInCallback();
|
|
85
|
+
* }
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* Use this in the setup script of your Callback page to make sure the injection works
|
|
90
|
+
*/
|
|
91
|
+
const useHandleSignInCallback = (returnToPageUrl = window.location.origin) => {
|
|
92
|
+
const context = (0, vue_1.inject)(consts_1.contextInjectionKey);
|
|
93
|
+
if (!context) {
|
|
94
|
+
return (0, context_1.throwContextError)();
|
|
95
|
+
}
|
|
96
|
+
const currentPageUrl = window.location.href;
|
|
97
|
+
const { isAuthenticated, isLoading, logtoClient, error } = context;
|
|
98
|
+
const { handleSignInCallback } = (0, plugin_1.createPluginMethods)(context);
|
|
99
|
+
(0, vue_1.watchEffect)(() => {
|
|
100
|
+
if (!isAuthenticated.value && logtoClient.value?.isSignInRedirected(currentPageUrl)) {
|
|
101
|
+
void handleSignInCallback(currentPageUrl, returnToPageUrl);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return {
|
|
105
|
+
isLoading: (0, vue_1.readonly)(isLoading),
|
|
106
|
+
isAuthenticated: (0, vue_1.readonly)(isAuthenticated),
|
|
107
|
+
error: (0, vue_1.readonly)(error),
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
exports.useHandleSignInCallback = useHandleSignInCallback;
|
package/lib/plugin.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Context } from './context';
|
|
2
|
+
export declare const createPluginMethods: (context: Context) => {
|
|
3
|
+
signIn: (redirectUri: string) => Promise<undefined>;
|
|
4
|
+
signOut: (postLogoutRedirectUri: string) => Promise<undefined>;
|
|
5
|
+
fetchUserInfo: () => Promise<import("@logto/browser").UserInfoResponse | undefined>;
|
|
6
|
+
getAccessToken: (resource?: string | undefined) => Promise<string | undefined>;
|
|
7
|
+
getIdTokenClaims: () => {
|
|
8
|
+
iss: string;
|
|
9
|
+
sub: string;
|
|
10
|
+
aud: string;
|
|
11
|
+
exp: number;
|
|
12
|
+
iat: number;
|
|
13
|
+
at_hash?: string | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
handleSignInCallback: (callbackUri: string, returnToPageUrl: string) => Promise<undefined>;
|
|
16
|
+
};
|
package/lib/plugin.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPluginMethods = void 0;
|
|
4
|
+
const context_1 = require("./context");
|
|
5
|
+
const createPluginMethods = (context) => {
|
|
6
|
+
const { logtoClient, setLoading, setError, setIsAuthenticated } = context;
|
|
7
|
+
const signIn = async (redirectUri) => {
|
|
8
|
+
if (!logtoClient.value) {
|
|
9
|
+
return (0, context_1.throwContextError)();
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
setLoading(true);
|
|
13
|
+
await logtoClient.value.signIn(redirectUri);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
setError(error, 'Unexpected error occurred while signing in.');
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
setLoading(false);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const signOut = async (postLogoutRedirectUri) => {
|
|
23
|
+
if (!logtoClient.value) {
|
|
24
|
+
return (0, context_1.throwContextError)();
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
setLoading(true);
|
|
28
|
+
await logtoClient.value.signOut(postLogoutRedirectUri);
|
|
29
|
+
setIsAuthenticated(false);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
setError(error, 'Unexpected error occurred while signing out.');
|
|
33
|
+
}
|
|
34
|
+
finally {
|
|
35
|
+
setLoading(false);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const fetchUserInfo = async () => {
|
|
39
|
+
if (!logtoClient.value) {
|
|
40
|
+
return (0, context_1.throwContextError)();
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
setLoading(true);
|
|
44
|
+
return await logtoClient.value.fetchUserInfo();
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
setError(error, 'Unexpected error occurred while fetching user info.');
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
setLoading(false);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const getAccessToken = async (resource) => {
|
|
54
|
+
if (!logtoClient.value) {
|
|
55
|
+
return (0, context_1.throwContextError)();
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
setLoading(true);
|
|
59
|
+
return await logtoClient.value.getAccessToken(resource);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
setError(error, 'Unexpected error occurred while getting access token.');
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
setLoading(false);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const getIdTokenClaims = () => {
|
|
69
|
+
if (!logtoClient.value) {
|
|
70
|
+
return (0, context_1.throwContextError)();
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
return logtoClient.value.getIdTokenClaims();
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
setError(error, 'Unexpected error occurred while getting id token claims.');
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const handleSignInCallback = async (callbackUri, returnToPageUrl) => {
|
|
80
|
+
if (!logtoClient.value) {
|
|
81
|
+
return (0, context_1.throwContextError)();
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
setLoading(true);
|
|
85
|
+
await logtoClient.value.handleSignInCallback(callbackUri);
|
|
86
|
+
setIsAuthenticated(true);
|
|
87
|
+
window.location.assign(returnToPageUrl);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
setError(error, 'Unexpected error occurred while handling sign in callback.');
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
setLoading(false);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
signIn,
|
|
98
|
+
signOut,
|
|
99
|
+
fetchUserInfo,
|
|
100
|
+
getAccessToken,
|
|
101
|
+
getIdTokenClaims,
|
|
102
|
+
handleSignInCallback,
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
exports.createPluginMethods = createPluginMethods;
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@logto/vue",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"main": "./lib/index.js",
|
|
5
|
+
"exports": "./lib/index.js",
|
|
6
|
+
"typings": "./lib/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/logto-io/js.git",
|
|
14
|
+
"directory": "packages/vue"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev:tsc": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
|
|
18
|
+
"preinstall": "npx only-allow pnpm",
|
|
19
|
+
"precommit": "lint-staged",
|
|
20
|
+
"build": "rm -rf lib/ && tsc -p tsconfig.build.json",
|
|
21
|
+
"lint": "eslint --ext .ts src",
|
|
22
|
+
"test": "jest",
|
|
23
|
+
"test:coverage": "jest --silent --coverage",
|
|
24
|
+
"prepack": "pnpm test"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@logto/browser": "^0.1.7"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@jest/types": "^27.5.1",
|
|
31
|
+
"@silverhand/eslint-config": "^0.14.0",
|
|
32
|
+
"@silverhand/ts-config": "^0.14.0",
|
|
33
|
+
"@types/jest": "^27.4.1",
|
|
34
|
+
"eslint": "^8.9.0",
|
|
35
|
+
"jest": "^27.5.1",
|
|
36
|
+
"lint-staged": "^12.3.4",
|
|
37
|
+
"postcss": "^8.4.6",
|
|
38
|
+
"prettier": "^2.5.1",
|
|
39
|
+
"stylelint": "^14.8.2",
|
|
40
|
+
"ts-jest": "^27.0.4",
|
|
41
|
+
"typescript": "^4.6.2",
|
|
42
|
+
"vue": "^3.2.35"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"vue": ">=3.0.0"
|
|
46
|
+
},
|
|
47
|
+
"eslintConfig": {
|
|
48
|
+
"extends": "@silverhand",
|
|
49
|
+
"rules": {
|
|
50
|
+
"unicorn/prevent-abbreviations": [
|
|
51
|
+
"error",
|
|
52
|
+
{
|
|
53
|
+
"replacements": {
|
|
54
|
+
"ref": false
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"prettier": "@silverhand/eslint-config/.prettierrc",
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
63
|
+
},
|
|
64
|
+
"gitHead": "8adf9495676b65649b093f9e8b460a1568e08e0a"
|
|
65
|
+
}
|