@deppon/deppon-norm 2.2.1 → 2.2.2

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 xingxing
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 xingxing
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/README.md CHANGED
@@ -1,119 +1,119 @@
1
- # `@deppon/deppon-norm`
2
-
3
- 前端规范工具包
4
-
5
- ## 安装
6
-
7
- ```bash
8
- npm install @deppon/deppon-norm
9
- ```
10
-
11
- ## 基础使用
12
-
13
- ### JavaScript/TypeScript 项目
14
-
15
- ```javascript
16
- import { commit, note, start, stylelint } from '@deppon/deppon-norm';
17
-
18
- // 使用 commit
19
- commit('commit message');
20
-
21
- // 使用 note
22
- note('note message');
23
-
24
- // 使用 start
25
- start('start message');
26
-
27
- // 使用 stylelint
28
- stylelint('stylelint message');
29
- ```
30
-
31
- ## Vue 3 使用
32
-
33
- ### 1. 安装插件
34
-
35
- 在 Vue 应用中安装插件:
36
-
37
- ```javascript
38
- import { createApp } from 'vue';
39
- import { VuePlugin } from '@deppon/deppon-norm';
40
-
41
- const app = createApp(App);
42
-
43
- // 安装插件
44
- app.use(VuePlugin);
45
-
46
- app.mount('#app');
47
- ```
48
-
49
- ### 2. 在 Composition API 中使用
50
-
51
- ```vue
52
- <script setup>
53
- import { useNorm } from '@deppon/deppon-norm';
54
-
55
- const norm = useNorm();
56
-
57
- const handleCommit = () => {
58
- norm.commit('commit message');
59
- };
60
-
61
- const handleNote = () => {
62
- norm.note('note message');
63
- };
64
-
65
- const handleStart = () => {
66
- norm.start('start message');
67
- };
68
-
69
- const handleStylelint = () => {
70
- norm.stylelint('stylelint message');
71
- };
72
- </script>
73
-
74
- <template>
75
- <button @click="handleCommit">Commit</button>
76
- <button @click="handleNote">Note</button>
77
- <button @click="handleStart">Start</button>
78
- <button @click="handleStylelint">Stylelint</button>
79
- </template>
80
- ```
81
-
82
- ### 3. 在 Options API 中使用
83
-
84
- ```vue
85
- <script>
86
- export default {
87
- methods: {
88
- handleCommit() {
89
- // 通过 this.$norm 访问
90
- this.$norm.commit('commit message');
91
- },
92
- handleNote() {
93
- this.$norm.note('note message');
94
- },
95
- handleStart() {
96
- this.$norm.start('start message');
97
- },
98
- handleStylelint() {
99
- this.$norm.stylelint('stylelint message');
100
- },
101
- },
102
- };
103
- </script>
104
- ```
105
-
106
- ## API
107
-
108
- ### Composition API
109
-
110
- - `useNorm()` - 获取 norm 实例
111
-
112
- ### 方法
113
-
114
- - `commit(param1)` - Commit 方法
115
- - `note(param1)` - Note 方法
116
- - `start(param1)` - Start 方法
117
- - `stylelint(param1)` - Stylelint 方法
118
-
119
- 更多 API 请参考源码。
1
+ # `@deppon/deppon-norm`
2
+
3
+ 前端规范工具包
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm install @deppon/deppon-norm
9
+ ```
10
+
11
+ ## 基础使用
12
+
13
+ ### JavaScript/TypeScript 项目
14
+
15
+ ```javascript
16
+ import { commit, note, start, stylelint } from '@deppon/deppon-norm';
17
+
18
+ // 使用 commit
19
+ commit('commit message');
20
+
21
+ // 使用 note
22
+ note('note message');
23
+
24
+ // 使用 start
25
+ start('start message');
26
+
27
+ // 使用 stylelint
28
+ stylelint('stylelint message');
29
+ ```
30
+
31
+ ## Vue 3 使用
32
+
33
+ ### 1. 安装插件
34
+
35
+ 在 Vue 应用中安装插件:
36
+
37
+ ```javascript
38
+ import { createApp } from 'vue';
39
+ import { VuePlugin } from '@deppon/deppon-norm';
40
+
41
+ const app = createApp(App);
42
+
43
+ // 安装插件
44
+ app.use(VuePlugin);
45
+
46
+ app.mount('#app');
47
+ ```
48
+
49
+ ### 2. 在 Composition API 中使用
50
+
51
+ ```vue
52
+ <script setup>
53
+ import { useNorm } from '@deppon/deppon-norm';
54
+
55
+ const norm = useNorm();
56
+
57
+ const handleCommit = () => {
58
+ norm.commit('commit message');
59
+ };
60
+
61
+ const handleNote = () => {
62
+ norm.note('note message');
63
+ };
64
+
65
+ const handleStart = () => {
66
+ norm.start('start message');
67
+ };
68
+
69
+ const handleStylelint = () => {
70
+ norm.stylelint('stylelint message');
71
+ };
72
+ </script>
73
+
74
+ <template>
75
+ <button @click="handleCommit">Commit</button>
76
+ <button @click="handleNote">Note</button>
77
+ <button @click="handleStart">Start</button>
78
+ <button @click="handleStylelint">Stylelint</button>
79
+ </template>
80
+ ```
81
+
82
+ ### 3. 在 Options API 中使用
83
+
84
+ ```vue
85
+ <script>
86
+ export default {
87
+ methods: {
88
+ handleCommit() {
89
+ // 通过 this.$norm 访问
90
+ this.$norm.commit('commit message');
91
+ },
92
+ handleNote() {
93
+ this.$norm.note('note message');
94
+ },
95
+ handleStart() {
96
+ this.$norm.start('start message');
97
+ },
98
+ handleStylelint() {
99
+ this.$norm.stylelint('stylelint message');
100
+ },
101
+ },
102
+ };
103
+ </script>
104
+ ```
105
+
106
+ ## API
107
+
108
+ ### Composition API
109
+
110
+ - `useNorm()` - 获取 norm 实例
111
+
112
+ ### 方法
113
+
114
+ - `commit(param1)` - Commit 方法
115
+ - `note(param1)` - Note 方法
116
+ - `start(param1)` - Start 方法
117
+ - `stylelint(param1)` - Stylelint 方法
118
+
119
+ 更多 API 请参考源码。
@@ -1,6 +1,6 @@
1
- export default commit;
2
- /**
3
- * 说明:
4
- *
5
- **/
6
- declare function commit(param1: any): void;
1
+ export default commit;
2
+ /**
3
+ * 说明:
4
+ *
5
+ **/
6
+ declare function commit(param1: any): void;
@@ -1,8 +1,8 @@
1
1
  import '../_virtual/_rollup-plugin-inject-process-env.js';
2
2
 
3
- /**
4
- * 说明:
5
- *
3
+ /**
4
+ * 说明:
5
+ *
6
6
  **/
7
7
  function commit(param1) {
8
8
  }
@@ -1,20 +1,20 @@
1
- /**
2
- * Composition API: useNorm
3
- * 在 Vue 3 Composition API 中使用 norm
4
- *
5
- * @example
6
- * import { useNorm } from '@deppon/deppon-norm/vue'
7
- *
8
- * export default {
9
- * setup() {
10
- * const norm = useNorm()
11
- *
12
- * const handleCommit = () => {
13
- * norm.commit('commit message')
14
- * }
15
- *
16
- * return { handleCommit }
17
- * }
18
- * }
19
- */
20
- export function useNorm(): any;
1
+ /**
2
+ * Composition API: useNorm
3
+ * 在 Vue 3 Composition API 中使用 norm
4
+ *
5
+ * @example
6
+ * import { useNorm } from '@deppon/deppon-norm/vue'
7
+ *
8
+ * export default {
9
+ * setup() {
10
+ * const norm = useNorm()
11
+ *
12
+ * const handleCommit = () => {
13
+ * norm.commit('commit message')
14
+ * }
15
+ *
16
+ * return { handleCommit }
17
+ * }
18
+ * }
19
+ */
20
+ export function useNorm(): any;
package/es/composable.js CHANGED
@@ -2,24 +2,24 @@ import './_virtual/_rollup-plugin-inject-process-env.js';
2
2
  import { inject, getCurrentInstance } from 'vue';
3
3
  import * as index from './index.js';
4
4
 
5
- /**
6
- * Composition API: useNorm
7
- * 在 Vue 3 Composition API 中使用 norm
8
- *
9
- * @example
10
- * import { useNorm } from '@deppon/deppon-norm/vue'
11
- *
12
- * export default {
13
- * setup() {
14
- * const norm = useNorm()
15
- *
16
- * const handleCommit = () => {
17
- * norm.commit('commit message')
18
- * }
19
- *
20
- * return { handleCommit }
21
- * }
22
- * }
5
+ /**
6
+ * Composition API: useNorm
7
+ * 在 Vue 3 Composition API 中使用 norm
8
+ *
9
+ * @example
10
+ * import { useNorm } from '@deppon/deppon-norm/vue'
11
+ *
12
+ * export default {
13
+ * setup() {
14
+ * const norm = useNorm()
15
+ *
16
+ * const handleCommit = () => {
17
+ * norm.commit('commit message')
18
+ * }
19
+ *
20
+ * return { handleCommit }
21
+ * }
22
+ * }
23
23
  */
24
24
  function useNorm() {
25
25
  // 优先从 provide 获取
package/es/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { default as commit } from "./commit/index";
2
- export { default as note } from "./note/index";
3
- export { default as start } from "./start/index";
4
- export { default as stylelint } from "./stylelint/index";
5
- export { default as VuePlugin } from "./vue";
6
- export { useNorm } from "./composable";
1
+ export { default as commit } from "./commit/index";
2
+ export { default as note } from "./note/index";
3
+ export { default as start } from "./start/index";
4
+ export { default as stylelint } from "./stylelint/index";
5
+ export { default as VuePlugin } from "./vue";
6
+ export { useNorm } from "./composable";
@@ -1,6 +1,6 @@
1
- export default note;
2
- /**
3
- * 说明:
4
- *
5
- **/
6
- declare function note(param1: any): void;
1
+ export default note;
2
+ /**
3
+ * 说明:
4
+ *
5
+ **/
6
+ declare function note(param1: any): void;
package/es/note/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import '../_virtual/_rollup-plugin-inject-process-env.js';
2
2
 
3
- /**
4
- * 说明:
5
- *
3
+ /**
4
+ * 说明:
5
+ *
6
6
  **/
7
7
  function note(param1) {
8
8
  }
@@ -1,6 +1,6 @@
1
- export default start;
2
- /**
3
- * 说明:
4
- *
5
- **/
6
- declare function start(param1: any): void;
1
+ export default start;
2
+ /**
3
+ * 说明:
4
+ *
5
+ **/
6
+ declare function start(param1: any): void;
package/es/start/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import '../_virtual/_rollup-plugin-inject-process-env.js';
2
2
 
3
- /**
4
- * 说明:
5
- *
3
+ /**
4
+ * 说明:
5
+ *
6
6
  **/
7
7
  function start(param1) {
8
8
  }
@@ -1,6 +1,6 @@
1
- export default stylelint;
2
- /**
3
- * 说明:
4
- *
5
- **/
6
- declare function stylelint(param1: any): void;
1
+ export default stylelint;
2
+ /**
3
+ * 说明:
4
+ *
5
+ **/
6
+ declare function stylelint(param1: any): void;
@@ -1,8 +1,8 @@
1
1
  import '../_virtual/_rollup-plugin-inject-process-env.js';
2
2
 
3
- /**
4
- * 说明:
5
- *
3
+ /**
4
+ * 说明:
5
+ *
6
6
  **/
7
7
  function stylelint(param1) {
8
8
  }
package/es/vue.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- declare namespace _default {
2
- export { install };
3
- }
4
- export default _default;
5
- export { useNorm } from "./composable";
6
- /**
7
- * Vue 插件安装函数
8
- * @param {Object} app - Vue 应用实例
9
- */
10
- declare function install(app: Object): void;
1
+ declare namespace _default {
2
+ export { install };
3
+ }
4
+ export default _default;
5
+ export { useNorm } from "./composable";
6
+ /**
7
+ * Vue 插件安装函数
8
+ * @param {Object} app - Vue 应用实例
9
+ */
10
+ declare function install(app: Object): void;
package/es/vue.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import './_virtual/_rollup-plugin-inject-process-env.js';
2
2
  import * as index from './index.js';
3
3
 
4
- /**
5
- * Vue 插件安装函数
6
- * @param {Object} app - Vue 应用实例
4
+ /**
5
+ * Vue 插件安装函数
6
+ * @param {Object} app - Vue 应用实例
7
7
  */
8
8
  function install(app) {
9
9
  // 注册全局属性
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deppon/deppon-norm",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "main": "es/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "es/index.d.ts",