@baic/yolk-cli 2.1.0-alpha.231 → 2.1.0-alpha.232

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.
@@ -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()} --loglevel=error`;
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 config = {
56
- '*.{md,json}': [prettierCLI],
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;
@@ -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()} --loglevel=error`;
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 config = {
56
- '*.{md,json}': [prettierCLI],
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.231",
3
+ "version": "2.1.0-alpha.232",
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.231",
29
- "@baic/eslint-config-yolk": "^2.1.0-alpha.231",
30
- "@baic/prettier-config-yolk": "^2.1.0-alpha.231",
31
- "@baic/stylelint-config-yolk": "^2.1.0-alpha.231",
32
- "@baic/yolk-prebundle": "^2.1.0-alpha.231",
28
+ "@baic/biome-config-yolk": "^2.1.0-alpha.232",
29
+ "@baic/eslint-config-yolk": "^2.1.0-alpha.232",
30
+ "@baic/prettier-config-yolk": "^2.1.0-alpha.232",
31
+ "@baic/stylelint-config-yolk": "^2.1.0-alpha.232",
32
+ "@baic/yolk-prebundle": "^2.1.0-alpha.232",
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.16.x"
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": "3eb7c963f19b35f1df279ba6452cb2af20932934"
66
+ "gitHead": "72015f26a84a56166657cbee5f8c4b2a29690165"
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, ListVirtualizedScrollEvent } from '@baic/yolk-mobile';
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: ListVirtualizedScrollEvent) => {
19
+ const onScrollHandler = useCallback(async (e: VirtualListScrollEvent) => {
20
20
  console.log(e);
21
21
  }, []);
22
- const virtualizedMemo = useMemo(
22
+ const virtualMemo = useMemo(
23
23
  () => ({
24
24
  height: 500,
25
- rowHeight: 60,
26
- onScroll: onScrollHandler,
25
+ itemHeight: 60,
26
+ onVirtualScroll: onScrollHandler,
27
27
  }),
28
28
  [onScrollHandler],
29
29
  );
30
30
  return (
31
- <List header="虚拟化" virtualized={virtualizedMemo} data={mock}>
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, ListVirtualizedScrollEvent } from '@baic/yolk-mobile';
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: ListVirtualizedScrollEvent) => {
18
+ async (e: VirtualListScrollEvent) => {
19
19
  console.log(e);
20
20
  },
21
21
  [],
22
22
  );
23
- const virtualizedMemo = React.useMemo(
23
+ const virtualMemo = React.useMemo(
24
24
  () => ({
25
25
  height: 500,
26
- rowHeight: 60,
27
- onScroll: onScrollHandler,
26
+ itemHeight: 60,
27
+ onVirtualScroll: onScrollHandler,
28
28
  }),
29
29
  [onScrollHandler],
30
30
  );
31
31
  return (
32
- <List header="虚拟化" virtualized={virtualizedMemo} data={mock}>
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, ListVirtualizedScrollEvent } from '@baic/yolk-mobile';
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: ListVirtualizedScrollEvent) => {
18
+ async (e: VirtualListScrollEvent) => {
19
19
  console.log(e);
20
20
  },
21
21
  [],
22
22
  );
23
- const virtualizedMemo = React.useMemo(
23
+ const virtualMemo = React.useMemo(
24
24
  () => ({
25
25
  height: 500,
26
- rowHeight: 60,
27
- onScroll: onScrollHandler,
26
+ itemHeight: 60,
27
+ onVirtualScroll: onScrollHandler,
28
28
  }),
29
29
  [onScrollHandler],
30
30
  );
31
31
  return (
32
- <List header="虚拟化" virtualized={virtualizedMemo} data={mock}>
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, ListVirtualizedScrollEvent } from '@baic/yolk-mobile';
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: ListVirtualizedScrollEvent) => {
19
+ const onScrollHandler = useCallback(async (e: VirtualListScrollEvent) => {
20
20
  console.log(e);
21
21
  }, []);
22
- const virtualizedMemo = useMemo(
22
+ const virtualMemo = useMemo(
23
23
  () => ({
24
24
  height: 500,
25
- rowHeight: 60,
26
- onScroll: onScrollHandler,
25
+ itemHeight: 60,
26
+ onVirtualScroll: onScrollHandler,
27
27
  }),
28
28
  [onScrollHandler],
29
29
  );
30
30
  return (
31
- <List header="虚拟化" virtualized={virtualizedMemo} data={mock}>
31
+ <List header="虚拟化" virtual={virtualMemo} data={mock}>
32
32
  {({ name, avatar, description }, index, e) => {
33
33
  return (
34
34
  <List.Item