@baic/yolk-cli 2.1.0-alpha.130 → 2.1.0-alpha.132

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.
Files changed (39) hide show
  1. package/compiled/commander/package.json +1 -1
  2. package/compiled/mustache/package.json +1 -1
  3. package/compiled/prettier/index.js +3 -3
  4. package/compiled/prettier/package.json +1 -1
  5. package/compiled/staged-git-files/package.json +1 -1
  6. package/es/.lintstagedrc.js +27 -0
  7. package/es/util.d.ts +18 -0
  8. package/es/util.js +1 -0
  9. package/es/yolk.d.ts +1 -5
  10. package/es/yolk.js +1 -1
  11. package/lib/.lintstagedrc.js +27 -0
  12. package/lib/util.d.ts +18 -0
  13. package/lib/util.js +1 -0
  14. package/lib/yolk.d.ts +1 -5
  15. package/lib/yolk.js +1 -1
  16. package/package.json +10 -12
  17. package/templates/miniprogram/project.config.json.tpl +1 -1
  18. package/templates/umi-mobile/src/pages/demo/index.tsx +3 -3
  19. package/templates/umi-mobile-h5+app/src/pages/demo/index.tsx +3 -3
  20. package/templates/umi-mobile-native/android/app/build.gradle +19 -4
  21. package/templates/umi-mobile-native/android/app/libs/Bluetooth-release.aar +0 -0
  22. package/templates/umi-mobile-native/android/gradle.properties +1 -1
  23. package/templates/umi-mobile-native/src/common/bluetooth.ts +6 -6
  24. package/templates/umi-mobile-native/src/common/bridge.ts +6 -6
  25. package/templates/umi-mobile-native/src/pages/demo/index.tsx +3 -3
  26. package/templates/umi-web/src/pages/demo/index.tsx +3 -3
  27. package/templates/umi-web-screen/src/components/resize-container/index.tsx +5 -5
  28. package/compiled/glob/index.d.ts +0 -102
  29. package/compiled/glob/index.js +0 -2222
  30. package/compiled/glob/package.json +0 -1
  31. package/compiled/minimatch/index.d.ts +0 -312
  32. package/compiled/minimatch/index.js +0 -1292
  33. package/compiled/minimatch/package.json +0 -1
  34. package/compiled/mkdirp/index.d.ts +0 -114
  35. package/compiled/mkdirp/index.js +0 -348
  36. package/compiled/mkdirp/package.json +0 -1
  37. package/compiled/rimraf/index.d.ts +0 -48
  38. package/compiled/rimraf/index.js +0 -449
  39. package/compiled/rimraf/package.json +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baic/yolk-cli",
3
- "version": "2.1.0-alpha.130",
3
+ "version": "2.1.0-alpha.132",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/303394539/yolk.git"
@@ -27,31 +27,29 @@
27
27
  "dependencies": {
28
28
  "@babel/runtime": "~7.x",
29
29
  "@types/inquirer": "~8.x",
30
+ "@types/lint-staged": "~13.2.x",
30
31
  "@types/lodash": "~4.x",
31
- "@types/prettier": "~2.x",
32
+ "glob": "~10.x",
32
33
  "inquirer": "~8.x",
34
+ "lint-staged": "~13.2.x",
33
35
  "lodash": "~4.x",
36
+ "minimatch": "~9.0.x",
34
37
  "miniprogram-ci": "~1.9.x",
38
+ "mkdirp": "~3.0.x",
35
39
  "ora": "5.4.1",
36
- "prettier": "~2.x",
40
+ "rimraf": "~5.0.x",
37
41
  "v8-compile-cache": "~2.3.x"
38
42
  },
39
43
  "devDependencies": {
40
- "@types/glob": "~8.x",
41
- "@types/minimatch": "~5.1.x",
42
- "@types/mkdirp": "~1.0.x",
43
44
  "@types/mustache": "~4.2.x",
44
- "@types/rimraf": "~3.0.x",
45
+ "@types/prettier": "~2.x",
45
46
  "commander": "~6.x",
46
- "glob": "~8.x",
47
- "minimatch": "~5.1.x",
48
- "mkdirp": "~1.0.x",
49
47
  "mustache": "~4.2.x",
50
- "rimraf": "~3.0.x",
48
+ "prettier": "~2.x",
51
49
  "staged-git-files": "~1.3.x"
52
50
  },
53
51
  "publishConfig": {
54
52
  "access": "public"
55
53
  },
56
- "gitHead": "982aa053fb24b10a7f4777fa97604d04463084de"
54
+ "gitHead": "45e55017fb356466b21cc6664eb0e4366a58e4f4"
57
55
  }
@@ -49,7 +49,7 @@
49
49
  "compileType": "miniprogram",
50
50
  "simulatorType": "wechat",
51
51
  "simulatorPluginLibVersion": {},
52
- "libVersion": "2.30.0",
52
+ "libVersion": "2.32.0",
53
53
  "condition": {},
54
54
  "srcMiniprogramRoot": "dist/",
55
55
  "packOptions": {
@@ -1,4 +1,4 @@
1
- import _ from 'lodash';
1
+ import { isFunction, isObject } from 'lodash';
2
2
 
3
3
  import type { FunctionComponent } from 'react';
4
4
  import { createElement } from 'react';
@@ -56,14 +56,14 @@ export default () => {
56
56
  <Tabs defaultActiveKey={keys[0]}>
57
57
  {keys.map((key) => {
58
58
  const tab = tabs[key];
59
- if (_.isFunction(tab)) {
59
+ if (isFunction(tab)) {
60
60
  return (
61
61
  <Tab key={key} title={key}>
62
62
  {createElement(tab)}
63
63
  </Tab>
64
64
  );
65
65
  }
66
- if (_.isObject(tab)) {
66
+ if (isObject(tab)) {
67
67
  const keys2 = Object.keys(tab);
68
68
  return (
69
69
  <Tab key={key} title={key}>
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
 
3
- import _ from 'lodash';
3
+ import { isFunction, isObject } from 'lodash';
4
4
 
5
5
  import { Tabs, Collapse } from 'antd-mobile';
6
6
 
@@ -55,14 +55,14 @@ export default () => {
55
55
  <Tabs defaultActiveKey={keys[0]}>
56
56
  {keys.map((key) => {
57
57
  const tab = tabs[key];
58
- if (_.isFunction(tab)) {
58
+ if (isFunction(tab)) {
59
59
  return (
60
60
  <Tab key={key} title={key}>
61
61
  {React.createElement(tab)}
62
62
  </Tab>
63
63
  );
64
64
  }
65
- if (_.isObject(tab)) {
65
+ if (isObject(tab)) {
66
66
  const keys2 = Object.keys(tab);
67
67
  return (
68
68
  <Tab key={key} title={key}>
@@ -7,13 +7,13 @@ android {
7
7
 
8
8
  defaultConfig {
9
9
  applicationId "plus.H5ECA1DEE"
10
- minSdk 21
11
- targetSdk 25
10
+ minSdkVersion 21
11
+ targetSdkVersion 25
12
12
  versionCode 100
13
13
  versionName '1.0.0'
14
14
  multiDexEnabled true
15
15
  ndk {
16
- abiFilters 'armeabi-v7a'
16
+ abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
17
17
  }
18
18
  }
19
19
 
@@ -51,16 +51,31 @@ android {
51
51
  sourceCompatibility JavaVersion.VERSION_1_8
52
52
  targetCompatibility JavaVersion.VERSION_1_8
53
53
  }
54
+
55
+ packagingOptions {
56
+ exclude 'resources.arsc'
57
+ exclude 'AndroidManifest.xml'
58
+ }
59
+
60
+ aaptOptions {
61
+ additionalParameters '--auto-add-overlay'
62
+ ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"
63
+ }
64
+
65
+ lint {
66
+ checkReleaseBuilds false
67
+ }
54
68
  }
55
69
 
56
70
  dependencies {
57
71
  // base
58
72
  implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
59
- implementation 'androidx.appcompat:appcompat:1.3.0'
73
+ implementation 'androidx.appcompat:appcompat:1.4.1'
60
74
  implementation 'androidx.legacy:legacy-support-v4:1.0.0'
61
75
  implementation 'androidx.recyclerview:recyclerview:1.2.1'
62
76
  implementation 'com.facebook.fresco:fresco:2.6.0'
63
77
  implementation 'com.facebook.fresco:animated-gif:2.6.0'
64
78
  implementation 'com.github.bumptech.glide:glide:4.13.1'
65
79
  implementation 'com.alibaba:fastjson:1.1.46.android'
80
+ implementation 'androidx.webkit:webkit:1.4.0'
66
81
  }
@@ -15,8 +15,8 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
15
15
  # Android operating system, and which are packaged with your app"s APK
16
16
  # https://developer.android.com/topic/libraries/support-library/androidx-rn
17
17
  android.useAndroidX=true
18
+ android.enableJetifier=true
18
19
  # Enables namespacing of each library's R class so that its R class includes only the
19
20
  # resources declared in the library itself and none from the library's dependencies,
20
21
  # thereby reducing the size of the R class for that library
21
22
  android.nonTransitiveRClass=true
22
- android.useNewApkCreator=false
@@ -1,4 +1,4 @@
1
- import _ from 'lodash';
1
+ import { isFunction, unionBy } from 'lodash';
2
2
 
3
3
  import { Toast } from 'antd-mobile';
4
4
 
@@ -112,7 +112,7 @@ class Bluetooth {
112
112
  content: '蓝牙设备断开',
113
113
  });
114
114
  }
115
- if (_.isFunction(e)) {
115
+ if (isFunction(e)) {
116
116
  e({ connected, deviceId });
117
117
  }
118
118
  });
@@ -123,7 +123,7 @@ class Bluetooth {
123
123
  ) {
124
124
  const { bluetooth } = window.plus || {};
125
125
  bluetooth.onBluetoothDeviceFound(({ devices = [] }) => {
126
- this.devices = _.unionBy(
126
+ this.devices = unionBy(
127
127
  this.devices.concat(
128
128
  devices.filter(
129
129
  ({ name }: plus.Bluetooth.BluetoothDeviceInfo) =>
@@ -132,7 +132,7 @@ class Bluetooth {
132
132
  ),
133
133
  'deviceId',
134
134
  );
135
- if (_.isFunction(e)) {
135
+ if (isFunction(e)) {
136
136
  e({ devices: this.devices });
137
137
  }
138
138
  });
@@ -142,7 +142,7 @@ class Bluetooth {
142
142
  const { bluetooth } = window.plus || {};
143
143
  const { notifyInterval = 200 } = this.options;
144
144
  bluetooth.onBLECharacteristicValueChange(({ value }) => {
145
- if (_.isFunction(onChange)) {
145
+ if (isFunction(onChange)) {
146
146
  if (notifyInterval > 0) {
147
147
  if (!this.isNotifyInterval) {
148
148
  onChange(value);
@@ -222,7 +222,7 @@ class Bluetooth {
222
222
  deviceId,
223
223
  serviceId,
224
224
  characteristicId,
225
- value: _.isFunction(onWriteValue) ? onWriteValue() : new ArrayBuffer(0),
225
+ value: isFunction(onWriteValue) ? onWriteValue() : new ArrayBuffer(0),
226
226
  });
227
227
  if (writeInterval > 0) {
228
228
  this.writeTimeoutId = setTimeout(
@@ -1,4 +1,4 @@
1
- import _ from 'lodash';
1
+ import { isFunction } from 'lodash';
2
2
 
3
3
  type Result<T = object> = {
4
4
  code: number;
@@ -17,24 +17,24 @@ const bridge = {
17
17
  ) {
18
18
  return new Promise<T | undefined>((resolve, reject) => {
19
19
  const successCallback = (event: Result<T>) => {
20
- if (_.isFunction(complete)) {
20
+ if (isFunction(complete)) {
21
21
  complete(event);
22
22
  }
23
23
  if (event) {
24
24
  const { code, data } = event;
25
25
  if (0 === code) {
26
- if (_.isFunction(success)) {
26
+ if (isFunction(success)) {
27
27
  success(data);
28
28
  }
29
29
  resolve(data);
30
30
  } else {
31
- if (_.isFunction(fail)) {
31
+ if (isFunction(fail)) {
32
32
  fail(event);
33
33
  }
34
34
  reject(event);
35
35
  }
36
36
  } else {
37
- if (_.isFunction(fail)) {
37
+ if (isFunction(fail)) {
38
38
  fail({
39
39
  code: -1,
40
40
  });
@@ -45,7 +45,7 @@ const bridge = {
45
45
  }
46
46
  };
47
47
  const failCallback = (event?: Result<T>) => {
48
- if (_.isFunction(fail)) {
48
+ if (isFunction(fail)) {
49
49
  fail(event);
50
50
  }
51
51
  reject(event);
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
 
3
- import _ from 'lodash';
3
+ import { isFunction, isObject } from 'lodash';
4
4
 
5
5
  import { Tabs, Collapse } from 'antd-mobile';
6
6
 
@@ -57,14 +57,14 @@ export default () => {
57
57
  <Tabs defaultActiveKey={keys[0]}>
58
58
  {keys.map((key) => {
59
59
  const tab = tabs[key];
60
- if (_.isFunction(tab)) {
60
+ if (isFunction(tab)) {
61
61
  return (
62
62
  <Tab key={key} title={key}>
63
63
  {React.createElement(tab)}
64
64
  </Tab>
65
65
  );
66
66
  }
67
- if (_.isObject(tab)) {
67
+ if (isObject(tab)) {
68
68
  const keys2 = Object.keys(tab);
69
69
  return (
70
70
  <Tab key={key} title={key}>
@@ -1,4 +1,4 @@
1
- import _ from 'lodash';
1
+ import { isFunction, isObject } from 'lodash';
2
2
 
3
3
  import * as React from 'react';
4
4
 
@@ -105,14 +105,14 @@ export default () => {
105
105
  <Tabs defaultActiveKey={keys[0]}>
106
106
  {keys.map((key) => {
107
107
  const tab = tabs[key];
108
- if (_.isFunction(tab)) {
108
+ if (isFunction(tab)) {
109
109
  return (
110
110
  <TabPane key={key} tab={key}>
111
111
  {React.createElement(tab)}
112
112
  </TabPane>
113
113
  );
114
114
  }
115
- if (_.isObject(tab)) {
115
+ if (isObject(tab)) {
116
116
  const keys2 = Object.keys(tab);
117
117
  return (
118
118
  <TabPane key={key} tab={key}>
@@ -1,4 +1,4 @@
1
- import _ from 'lodash';
1
+ import { isFunction, isNumber } from 'lodash';
2
2
  import classnames from 'classnames';
3
3
 
4
4
  import type { ReactNode, RefObject } from 'react';
@@ -38,7 +38,7 @@ const Component = forwardRef<ContainerInstance, ResizeContainerProps>(
38
38
  ) => {
39
39
  const containerRef = useRef<HTMLDivElement>(null);
40
40
  const { width = 0, height = 0 } = useSize(
41
- _.isFunction(getContainer)
41
+ isFunction(getContainer)
42
42
  ? getContainer()
43
43
  : () => containerRef.current?.parentElement || null,
44
44
  ) || { width: 0, height: 0 };
@@ -50,7 +50,7 @@ const Component = forwardRef<ContainerInstance, ResizeContainerProps>(
50
50
  container: containerRef.current,
51
51
  };
52
52
  if (containerRef.current) {
53
- const $zoom = _.isNumber(containerParentElementZoom)
53
+ const $zoom = isNumber(containerParentElementZoom)
54
54
  ? containerParentElementZoom
55
55
  : containerParentElementZoom
56
56
  ? Number(document.body.getAttribute('data-zoom') || 1)
@@ -68,7 +68,7 @@ const Component = forwardRef<ContainerInstance, ResizeContainerProps>(
68
68
  containerRef.current.style.zoom = 1 / $zoom;
69
69
  }
70
70
  }
71
- if (_.isFunction(onResize)) {
71
+ if (isFunction(onResize)) {
72
72
  onResize(res);
73
73
  }
74
74
  return res;
@@ -79,7 +79,7 @@ const Component = forwardRef<ContainerInstance, ResizeContainerProps>(
79
79
  if (0 === containerWidth || 0 === containerHeight) {
80
80
  return null;
81
81
  }
82
- return _.isFunction(children) ? children(instance) : children;
82
+ return isFunction(children) ? children(instance) : children;
83
83
  }, [children, instance]);
84
84
  return (
85
85
  <div
@@ -1,102 +0,0 @@
1
- /// <reference types="node" />
2
-
3
- import events = require('events');
4
- import fs = require('fs');
5
- import minimatch = require('minimatch');
6
-
7
- export declare type ___promisify__ = G.___promisify__;
8
-
9
- declare function G(pattern: string, cb: (err: Error | null, matches: string[]) => void): G.IGlob;
10
-
11
- declare function G(pattern: string, options: G.IOptions, cb: (err: Error | null, matches: string[]) => void): G.IGlob;
12
-
13
- declare namespace G {
14
- function __promisify__(pattern: string, options?: IOptions): Promise<string[]>;
15
-
16
- function sync(pattern: string, options?: IOptions): string[];
17
-
18
- function hasMagic(pattern: string, options?: IOptions): boolean;
19
-
20
- let glob: typeof G;
21
- let Glob: IGlobStatic;
22
- let GlobSync: IGlobSyncStatic;
23
-
24
- interface IOptions extends minimatch.IOptions {
25
- cwd?: string | undefined;
26
- root?: string | undefined;
27
- dot?: boolean | undefined;
28
- nomount?: boolean | undefined;
29
- mark?: boolean | undefined;
30
- nosort?: boolean | undefined;
31
- stat?: boolean | undefined;
32
- silent?: boolean | undefined;
33
- strict?: boolean | undefined;
34
- cache?: { [path: string]: boolean | 'DIR' | 'FILE' | ReadonlyArray<string> } | undefined;
35
- statCache?: { [path: string]: false | { isDirectory(): boolean} | undefined } | undefined;
36
- symlinks?: { [path: string]: boolean | undefined } | undefined;
37
- realpathCache?: { [path: string]: string } | undefined;
38
- sync?: boolean | undefined;
39
- nounique?: boolean | undefined;
40
- nonull?: boolean | undefined;
41
- debug?: boolean | undefined;
42
- nobrace?: boolean | undefined;
43
- noglobstar?: boolean | undefined;
44
- noext?: boolean | undefined;
45
- nocase?: boolean | undefined;
46
- matchBase?: any;
47
- nodir?: boolean | undefined;
48
- ignore?: string | ReadonlyArray<string> | undefined;
49
- follow?: boolean | undefined;
50
- realpath?: boolean | undefined;
51
- nonegate?: boolean | undefined;
52
- nocomment?: boolean | undefined;
53
- absolute?: boolean | undefined;
54
- allowWindowsEscape?: boolean | undefined;
55
- fs?: typeof fs;
56
- }
57
-
58
- interface IGlobStatic extends events.EventEmitter {
59
- new (pattern: string, cb?: (err: Error | null, matches: string[]) => void): IGlob;
60
- new (pattern: string, options: IOptions, cb?: (err: Error | null, matches: string[]) => void): IGlob;
61
- prototype: IGlob;
62
- }
63
-
64
- interface IGlobSyncStatic {
65
- new (pattern: string, options?: IOptions): IGlobBase;
66
- prototype: IGlobBase;
67
- }
68
-
69
- interface IGlobBase {
70
- minimatch: minimatch.IMinimatch;
71
- options: IOptions;
72
- aborted: boolean;
73
- cache: { [path: string]: boolean | 'DIR' | 'FILE' | ReadonlyArray<string> };
74
- statCache: { [path: string]: false | { isDirectory(): boolean; } | undefined };
75
- symlinks: { [path: string]: boolean | undefined };
76
- realpathCache: { [path: string]: string };
77
- found: string[];
78
- }
79
-
80
- interface IGlob extends IGlobBase, events.EventEmitter {
81
- pause(): void;
82
- resume(): void;
83
- abort(): void;
84
- }
85
- }
86
- export default G;
87
-
88
- export declare type hasMagic = G.hasMagic;
89
-
90
- export declare type IGlob = G.IGlob;
91
-
92
- export declare type IGlobBase = G.IGlobBase;
93
-
94
- export declare type IGlobStatic = G.IGlobStatic;
95
-
96
- export declare type IGlobSyncStatic = G.IGlobSyncStatic;
97
-
98
- export declare type IOptions = G.IOptions;
99
-
100
- export declare type sync = G.sync;
101
-
102
- export { }