@baic/yolk-cli 2.1.0-alpha.231 → 2.1.0-alpha.233
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/es/.lintstagedrc.js +13 -5
- package/lib/.lintstagedrc.js +13 -5
- package/package.json +8 -8
- package/templates/umi-mobile/src/pages/demo/examples/List/4.tsx +6 -6
- package/templates/umi-mobile-h5+app/src/pages/demo/examples/List/4.tsx +6 -6
- package/templates/umi-mobile-native/src/pages/demo/examples/List/4.tsx +6 -6
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/List/4.tsx +6 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Baic
|
|
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/es/.lintstagedrc.js
CHANGED
|
@@ -5,6 +5,7 @@ const {
|
|
|
5
5
|
getEsLintConfigPath,
|
|
6
6
|
getStyleLintConfigPath,
|
|
7
7
|
getPrettierConfigPath,
|
|
8
|
+
getBiomeConfigPath,
|
|
8
9
|
} = require('./_util');
|
|
9
10
|
|
|
10
11
|
const defaultIgnore = [
|
|
@@ -34,7 +35,7 @@ const cacheDirPath = join(process.cwd(), 'node_modules', '.cache');
|
|
|
34
35
|
const prettierCLI = `prettier --write --cache --cache-strategy=content --cache-location=${join(
|
|
35
36
|
cacheDirPath,
|
|
36
37
|
'.prettiercache',
|
|
37
|
-
)} --config ${getPrettierConfigPath()}
|
|
38
|
+
)} --config ${getPrettierConfigPath()} --no-error-on-unmatched-pattern`;
|
|
38
39
|
const eslintCLI = `eslint --fix ${
|
|
39
40
|
isStrict ? '--no-inline-config' : ''
|
|
40
41
|
} --no-error-on-unmatched-pattern --cache --cache-strategy=content --cache-location=${join(
|
|
@@ -52,8 +53,10 @@ const stylelintCLI = `stylelint --fix ${
|
|
|
52
53
|
.map((i) => `--ignore-pattern ${i}`)
|
|
53
54
|
.join(' ')}`;
|
|
54
55
|
|
|
55
|
-
const
|
|
56
|
-
|
|
56
|
+
const biomeCli = `biome check --write --unsafe --no-errors-on-unmatched --log-level=error --files-ignore-unknown=true --config-path=${getBiomeConfigPath()}`;
|
|
57
|
+
|
|
58
|
+
const originConfig = {
|
|
59
|
+
'*.{md,json,jsonc}': [prettierCLI],
|
|
57
60
|
// '*.{png,jpeg,jpg,gif,svg}': ['imagemin-lint-staged'],
|
|
58
61
|
'*.css': [prettierCLI, `${stylelintCLI} --custom-syntax postcss`],
|
|
59
62
|
'*.less': [prettierCLI, `${stylelintCLI} --custom-syntax postcss-less`],
|
|
@@ -61,8 +64,13 @@ const config = {
|
|
|
61
64
|
prettierCLI,
|
|
62
65
|
`${stylelintCLI} --custom-syntax postcss-scss`,
|
|
63
66
|
],
|
|
64
|
-
'*.{js,jsx}': [prettierCLI, eslintCLI],
|
|
65
|
-
'*.{ts,tsx}': [`${prettierCLI} --parser=typescript`, eslintCLI],
|
|
67
|
+
'*.{js,jsx,cjs,mjs}': [prettierCLI, eslintCLI],
|
|
68
|
+
'*.{ts,tsx,cts,mts}': [`${prettierCLI} --parser=typescript`, eslintCLI],
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const config = {
|
|
72
|
+
...originConfig,
|
|
73
|
+
[`!(${Object.keys(originConfig).join('|')})`]: [biomeCli],
|
|
66
74
|
};
|
|
67
75
|
|
|
68
76
|
module.exports = config;
|
package/lib/.lintstagedrc.js
CHANGED
|
@@ -5,6 +5,7 @@ const {
|
|
|
5
5
|
getEsLintConfigPath,
|
|
6
6
|
getStyleLintConfigPath,
|
|
7
7
|
getPrettierConfigPath,
|
|
8
|
+
getBiomeConfigPath,
|
|
8
9
|
} = require('./_util');
|
|
9
10
|
|
|
10
11
|
const defaultIgnore = [
|
|
@@ -34,7 +35,7 @@ const cacheDirPath = join(process.cwd(), 'node_modules', '.cache');
|
|
|
34
35
|
const prettierCLI = `prettier --write --cache --cache-strategy=content --cache-location=${join(
|
|
35
36
|
cacheDirPath,
|
|
36
37
|
'.prettiercache',
|
|
37
|
-
)} --config ${getPrettierConfigPath()}
|
|
38
|
+
)} --config ${getPrettierConfigPath()} --no-error-on-unmatched-pattern`;
|
|
38
39
|
const eslintCLI = `eslint --fix ${
|
|
39
40
|
isStrict ? '--no-inline-config' : ''
|
|
40
41
|
} --no-error-on-unmatched-pattern --cache --cache-strategy=content --cache-location=${join(
|
|
@@ -52,8 +53,10 @@ const stylelintCLI = `stylelint --fix ${
|
|
|
52
53
|
.map((i) => `--ignore-pattern ${i}`)
|
|
53
54
|
.join(' ')}`;
|
|
54
55
|
|
|
55
|
-
const
|
|
56
|
-
|
|
56
|
+
const biomeCli = `biome check --write --unsafe --no-errors-on-unmatched --log-level=error --files-ignore-unknown=true --config-path=${getBiomeConfigPath()}`;
|
|
57
|
+
|
|
58
|
+
const originConfig = {
|
|
59
|
+
'*.{md,json,jsonc}': [prettierCLI],
|
|
57
60
|
// '*.{png,jpeg,jpg,gif,svg}': ['imagemin-lint-staged'],
|
|
58
61
|
'*.css': [prettierCLI, `${stylelintCLI} --custom-syntax postcss`],
|
|
59
62
|
'*.less': [prettierCLI, `${stylelintCLI} --custom-syntax postcss-less`],
|
|
@@ -61,8 +64,13 @@ const config = {
|
|
|
61
64
|
prettierCLI,
|
|
62
65
|
`${stylelintCLI} --custom-syntax postcss-scss`,
|
|
63
66
|
],
|
|
64
|
-
'*.{js,jsx}': [prettierCLI, eslintCLI],
|
|
65
|
-
'*.{ts,tsx}': [`${prettierCLI} --parser=typescript`, eslintCLI],
|
|
67
|
+
'*.{js,jsx,cjs,mjs}': [prettierCLI, eslintCLI],
|
|
68
|
+
'*.{ts,tsx,cts,mts}': [`${prettierCLI} --parser=typescript`, eslintCLI],
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const config = {
|
|
72
|
+
...originConfig,
|
|
73
|
+
[`!(${Object.keys(originConfig).join('|')})`]: [biomeCli],
|
|
66
74
|
};
|
|
67
75
|
|
|
68
76
|
module.exports = config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baic/yolk-cli",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.233",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/303394539/yolk.git"
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"prebundle": "father prebundle"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@baic/biome-config-yolk": "^2.1.0-alpha.
|
|
29
|
-
"@baic/eslint-config-yolk": "^2.1.0-alpha.
|
|
30
|
-
"@baic/prettier-config-yolk": "^2.1.0-alpha.
|
|
31
|
-
"@baic/stylelint-config-yolk": "^2.1.0-alpha.
|
|
32
|
-
"@baic/yolk-prebundle": "^2.1.0-alpha.
|
|
28
|
+
"@baic/biome-config-yolk": "^2.1.0-alpha.233",
|
|
29
|
+
"@baic/eslint-config-yolk": "^2.1.0-alpha.233",
|
|
30
|
+
"@baic/prettier-config-yolk": "^2.1.0-alpha.233",
|
|
31
|
+
"@baic/stylelint-config-yolk": "^2.1.0-alpha.233",
|
|
32
|
+
"@baic/yolk-prebundle": "^2.1.0-alpha.233",
|
|
33
33
|
"@biomejs/biome": "~1.8.x",
|
|
34
34
|
"@democrance/imagemin-lint-staged": "2.x",
|
|
35
35
|
"@types/inquirer": "8.x",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"postcss-scss": "~4.0.x",
|
|
50
50
|
"prettier": "2.x",
|
|
51
51
|
"stylelint": "14.x",
|
|
52
|
-
"tsx": "~4.
|
|
52
|
+
"tsx": "~4.17.x"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/mustache": "~4.2.x",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "61c631bfa6126e8b1e7a5c4707de368d5df0eed1"
|
|
67
67
|
}
|
|
@@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { Image } from 'antd-mobile';
|
|
4
4
|
|
|
5
|
-
import { List,
|
|
5
|
+
import { List, VirtualListScrollEvent } from '@baic/yolk-mobile';
|
|
6
6
|
|
|
7
7
|
const rowCount = 100000;
|
|
8
8
|
|
|
@@ -16,19 +16,19 @@ const item = {
|
|
|
16
16
|
const mock = Array(rowCount).fill(item);
|
|
17
17
|
|
|
18
18
|
export default () => {
|
|
19
|
-
const onScrollHandler = useCallback(async (e:
|
|
19
|
+
const onScrollHandler = useCallback(async (e: VirtualListScrollEvent) => {
|
|
20
20
|
console.log(e);
|
|
21
21
|
}, []);
|
|
22
|
-
const
|
|
22
|
+
const virtualMemo = useMemo(
|
|
23
23
|
() => ({
|
|
24
24
|
height: 500,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
itemHeight: 60,
|
|
26
|
+
onVirtualScroll: onScrollHandler,
|
|
27
27
|
}),
|
|
28
28
|
[onScrollHandler],
|
|
29
29
|
);
|
|
30
30
|
return (
|
|
31
|
-
<List header="虚拟化"
|
|
31
|
+
<List header="虚拟化" virtual={virtualMemo} data={mock}>
|
|
32
32
|
{({ name, avatar, description }, index, e) => {
|
|
33
33
|
return (
|
|
34
34
|
<List.Item
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Image } from 'antd-mobile';
|
|
3
|
-
import { List,
|
|
3
|
+
import { List, VirtualListScrollEvent } from '@baic/yolk-mobile';
|
|
4
4
|
|
|
5
5
|
const rowCount = 100000;
|
|
6
6
|
|
|
@@ -15,21 +15,21 @@ const mock = Array(rowCount).fill(item);
|
|
|
15
15
|
|
|
16
16
|
export default () => {
|
|
17
17
|
const onScrollHandler = React.useCallback(
|
|
18
|
-
async (e:
|
|
18
|
+
async (e: VirtualListScrollEvent) => {
|
|
19
19
|
console.log(e);
|
|
20
20
|
},
|
|
21
21
|
[],
|
|
22
22
|
);
|
|
23
|
-
const
|
|
23
|
+
const virtualMemo = React.useMemo(
|
|
24
24
|
() => ({
|
|
25
25
|
height: 500,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
itemHeight: 60,
|
|
27
|
+
onVirtualScroll: onScrollHandler,
|
|
28
28
|
}),
|
|
29
29
|
[onScrollHandler],
|
|
30
30
|
);
|
|
31
31
|
return (
|
|
32
|
-
<List header="虚拟化"
|
|
32
|
+
<List header="虚拟化" virtual={virtualMemo} data={mock}>
|
|
33
33
|
{({ name, avatar, description }, index, e) => {
|
|
34
34
|
return (
|
|
35
35
|
<List.Item
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Image } from 'antd-mobile';
|
|
3
|
-
import { List,
|
|
3
|
+
import { List, VirtualListScrollEvent } from '@baic/yolk-mobile';
|
|
4
4
|
|
|
5
5
|
const rowCount = 100000;
|
|
6
6
|
|
|
@@ -15,21 +15,21 @@ const mock = Array(rowCount).fill(item);
|
|
|
15
15
|
|
|
16
16
|
export default () => {
|
|
17
17
|
const onScrollHandler = React.useCallback(
|
|
18
|
-
async (e:
|
|
18
|
+
async (e: VirtualListScrollEvent) => {
|
|
19
19
|
console.log(e);
|
|
20
20
|
},
|
|
21
21
|
[],
|
|
22
22
|
);
|
|
23
|
-
const
|
|
23
|
+
const virtualMemo = React.useMemo(
|
|
24
24
|
() => ({
|
|
25
25
|
height: 500,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
itemHeight: 60,
|
|
27
|
+
onVirtualScroll: onScrollHandler,
|
|
28
28
|
}),
|
|
29
29
|
[onScrollHandler],
|
|
30
30
|
);
|
|
31
31
|
return (
|
|
32
|
-
<List header="虚拟化"
|
|
32
|
+
<List header="虚拟化" virtual={virtualMemo} data={mock}>
|
|
33
33
|
{({ name, avatar, description }, index, e) => {
|
|
34
34
|
return (
|
|
35
35
|
<List.Item
|
|
@@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { Image } from 'antd-mobile';
|
|
4
4
|
|
|
5
|
-
import { List,
|
|
5
|
+
import { List, VirtualListScrollEvent } from '@baic/yolk-mobile';
|
|
6
6
|
|
|
7
7
|
const rowCount = 100000;
|
|
8
8
|
|
|
@@ -16,19 +16,19 @@ const item = {
|
|
|
16
16
|
const mock = Array(rowCount).fill(item);
|
|
17
17
|
|
|
18
18
|
export default () => {
|
|
19
|
-
const onScrollHandler = useCallback(async (e:
|
|
19
|
+
const onScrollHandler = useCallback(async (e: VirtualListScrollEvent) => {
|
|
20
20
|
console.log(e);
|
|
21
21
|
}, []);
|
|
22
|
-
const
|
|
22
|
+
const virtualMemo = useMemo(
|
|
23
23
|
() => ({
|
|
24
24
|
height: 500,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
itemHeight: 60,
|
|
26
|
+
onVirtualScroll: onScrollHandler,
|
|
27
27
|
}),
|
|
28
28
|
[onScrollHandler],
|
|
29
29
|
);
|
|
30
30
|
return (
|
|
31
|
-
<List header="虚拟化"
|
|
31
|
+
<List header="虚拟化" virtual={virtualMemo} data={mock}>
|
|
32
32
|
{({ name, avatar, description }, index, e) => {
|
|
33
33
|
return (
|
|
34
34
|
<List.Item
|