@pixui-dev/pxw 0.1.20 → 0.1.21

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 (95) hide show
  1. package/bin/pxw.js +199 -199
  2. package/bin/wpbuild.js +10 -10
  3. package/config/default.conf +20 -20
  4. package/config/devops.js +372 -361
  5. package/config/h5es.js +10 -10
  6. package/config/index.html +183 -181
  7. package/config/pfbs.js +245 -245
  8. package/config/util.js +140 -140
  9. package/config/webpack.js +325 -309
  10. package/lib/assets/check.html +62 -62
  11. package/lib/assets/preact.js +4354 -4354
  12. package/lib/check/main.less +62 -62
  13. package/lib/check/main.tsx +41 -41
  14. package/lib/check/tool.js +3 -3
  15. package/lib/check/util.tsx +110 -110
  16. package/lib/grpc-web/dist/ChunkParser.js +117 -117
  17. package/lib/grpc-web/dist/Code.js +58 -58
  18. package/lib/grpc-web/dist/client.js +299 -299
  19. package/lib/grpc-web/dist/debug.js +16 -16
  20. package/lib/grpc-web/dist/detach.js +7 -7
  21. package/lib/grpc-web/dist/index.js +29 -29
  22. package/lib/grpc-web/dist/invoke.js +32 -32
  23. package/lib/grpc-web/dist/message.js +3 -3
  24. package/lib/grpc-web/dist/metadata.js +5 -5
  25. package/lib/grpc-web/dist/service.js +3 -3
  26. package/lib/grpc-web/dist/transports/Transport.js +15 -15
  27. package/lib/grpc-web/dist/transports/http/fetch.js +117 -117
  28. package/lib/grpc-web/dist/transports/http/http.js +15 -15
  29. package/lib/grpc-web/dist/transports/http/xhr.js +136 -136
  30. package/lib/grpc-web/dist/transports/http/xhrUtil.js +36 -36
  31. package/lib/grpc-web/dist/transports/websocket/websocket.js +95 -95
  32. package/lib/grpc-web/dist/typings/ChunkParser.d.ts +17 -17
  33. package/lib/grpc-web/dist/typings/Code.d.ts +20 -20
  34. package/lib/grpc-web/dist/typings/client.d.ts +25 -25
  35. package/lib/grpc-web/dist/typings/debug.d.ts +1 -1
  36. package/lib/grpc-web/dist/typings/detach.d.ts +1 -1
  37. package/lib/grpc-web/dist/typings/index.d.ts +45 -45
  38. package/lib/grpc-web/dist/typings/invoke.d.ts +20 -20
  39. package/lib/grpc-web/dist/typings/message.d.ts +8 -8
  40. package/lib/grpc-web/dist/typings/metadata.d.ts +2 -2
  41. package/lib/grpc-web/dist/typings/service.d.ts +16 -16
  42. package/lib/grpc-web/dist/typings/transports/Transport.d.ts +22 -22
  43. package/lib/grpc-web/dist/typings/transports/http/fetch.d.ts +6 -6
  44. package/lib/grpc-web/dist/typings/transports/http/http.d.ts +5 -5
  45. package/lib/grpc-web/dist/typings/transports/http/xhr.d.ts +27 -27
  46. package/lib/grpc-web/dist/typings/transports/http/xhrUtil.d.ts +3 -3
  47. package/lib/grpc-web/dist/typings/transports/websocket/websocket.d.ts +2 -2
  48. package/lib/grpc-web/dist/typings/unary.d.ts +23 -23
  49. package/lib/grpc-web/dist/typings/util.d.ts +2 -2
  50. package/lib/grpc-web/dist/unary.js +44 -44
  51. package/lib/grpc-web/dist/util.js +11 -11
  52. package/lib/grpcTransport/PixHttp2Transport.ts +107 -107
  53. package/lib/grpcTransport/PixLuaTransport.ts +82 -82
  54. package/lib/h5es-types/v1.9.2/h5es.d.ts +1698 -1698
  55. package/lib/h5es-types/v3.5.0/h5es.d.ts +1788 -1788
  56. package/lib/pi_component/tinyList/tinyList.js +483 -483
  57. package/lib/pi_component/tinyList/tinyList.tsx +517 -517
  58. package/lib/preact-router.js +395 -395
  59. package/lib/preact.js +4355 -4355
  60. package/lib/preact.tq.js +4385 -4385
  61. package/lib/react-window/src/FixedSizeGrid.js +172 -172
  62. package/lib/react-window/src/FixedSizeList.js +91 -91
  63. package/lib/react-window/src/VariableSizeGrid.js +329 -329
  64. package/lib/react-window/src/VariableSizeList.js +231 -231
  65. package/lib/react-window/src/__tests__/FixedSizeGrid.js +942 -942
  66. package/lib/react-window/src/__tests__/FixedSizeList.js +749 -749
  67. package/lib/react-window/src/__tests__/VariableSizeGrid.js +598 -598
  68. package/lib/react-window/src/__tests__/VariableSizeList.js +345 -345
  69. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeGrid.js.snap +912 -912
  70. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeList.js.snap +568 -568
  71. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeGrid.js.snap +542 -542
  72. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeList.js.snap +331 -331
  73. package/lib/react-window/src/__tests__/areEqual.js +28 -28
  74. package/lib/react-window/src/__tests__/shouldComponentUpdate.js +32 -32
  75. package/lib/react-window/src/areEqual.js +13 -13
  76. package/lib/react-window/src/createGridComponent.js +657 -657
  77. package/lib/react-window/src/createListComponent.js +574 -574
  78. package/lib/react-window/src/domHelpers.js +69 -69
  79. package/lib/react-window/src/index.js +9 -9
  80. package/lib/react-window/src/shallowDiffers.js +17 -17
  81. package/lib/react-window/src/shouldComponentUpdate.js +11 -11
  82. package/lib/react-window/src/test.js.flow +382 -382
  83. package/lib/react-window/src/timer.js +36 -36
  84. package/lib/types/dom.ts +17 -17
  85. package/lib/types/ext.d.ts +81 -81
  86. package/lib/types/preact/css.d.ts +7476 -7476
  87. package/lib/types/preact/index.d.ts +340 -340
  88. package/lib/types/preact/internal.d.ts +94 -94
  89. package/lib/types/preact/jsx.d.ts +309 -309
  90. package/lib/types/preact-router/index.d.ts +84 -84
  91. package/package.json +113 -113
  92. package/scripts/pack.js +40 -40
  93. package/scripts/postinstall.js +11 -11
  94. package/scripts/run-pxw.js +12 -12
  95. package/tsconfig.json +30 -30
@@ -1,85 +1,85 @@
1
- import * as preact from 'preact';
2
-
3
- export function route(url: string, replace?: boolean): boolean;
4
- export function route(options: { url: string; replace?: boolean }): boolean;
5
-
6
- export function getCurrentUrl(): string;
7
-
8
- export interface Location {
9
- pathname: string;
10
- search: string;
11
- }
12
-
13
- export interface CustomHistory {
14
- listen(callback: (location: Location) => void): () => void;
15
- location: Location;
16
- push(path: string): void;
17
- replace(path: string): void;
18
- }
19
-
20
- export interface RoutableProps {
21
- path?: string;
22
- default?: boolean;
23
- }
24
-
25
- export interface RouterOnChangeArgs {
26
- router: Router;
27
- url: string;
28
- previous?: string;
29
- active: preact.VNode[];
30
- current: preact.VNode;
31
- }
32
-
33
- export interface RouterProps extends RoutableProps {
34
- history?: CustomHistory;
35
- static?: boolean;
36
- url?: string;
37
- onChange?: (args: RouterOnChangeArgs) => void;
38
- }
39
-
40
- export class Router extends preact.Component<RouterProps, {}> {
41
- canRoute(url: string): boolean;
42
- getMatchingChildren(
43
- children: preact.VNode[],
44
- url: string,
45
- invoke: boolean
46
- ): preact.VNode[];
47
- routeTo(url: string): boolean;
48
- render(props: RouterProps, {}): preact.VNode;
49
- }
50
-
51
- export const subscribers: Array<(url: string) => void>
52
-
53
- type AnyComponent<Props> =
54
- | preact.FunctionalComponent<Props>
55
- | preact.ComponentConstructor<Props, any>;
56
-
57
- export interface RouteProps<Props> extends RoutableProps {
58
- component: AnyComponent<Props>;
59
- }
60
-
61
- export function Route<Props>(
62
- props: RouteProps<Props> & Partial<Props>
63
- ): preact.VNode;
64
-
65
- export function Link(props: {activeClassName?: string} & preact.JSX.HTMLAttributes): preact.VNode;
66
-
67
- export class Match extends preact.Component<RoutableProps, {}> {
68
- render(): preact.VNode;
69
- }
70
-
71
- export interface LinkProps extends preact.JSX.HTMLAttributes {
72
- activeClassName?: string;
73
- children?: preact.ComponentChildren;
74
- }
75
-
76
- export function Link(props: LinkProps): preact.VNode;
77
-
78
- declare module 'preact' {
79
- export interface Attributes extends RoutableProps {}
80
- }
81
-
82
- export{
83
- Router,
84
- Match
1
+ import * as preact from 'preact';
2
+
3
+ export function route(url: string, replace?: boolean): boolean;
4
+ export function route(options: { url: string; replace?: boolean }): boolean;
5
+
6
+ export function getCurrentUrl(): string;
7
+
8
+ export interface Location {
9
+ pathname: string;
10
+ search: string;
11
+ }
12
+
13
+ export interface CustomHistory {
14
+ listen(callback: (location: Location) => void): () => void;
15
+ location: Location;
16
+ push(path: string): void;
17
+ replace(path: string): void;
18
+ }
19
+
20
+ export interface RoutableProps {
21
+ path?: string;
22
+ default?: boolean;
23
+ }
24
+
25
+ export interface RouterOnChangeArgs {
26
+ router: Router;
27
+ url: string;
28
+ previous?: string;
29
+ active: preact.VNode[];
30
+ current: preact.VNode;
31
+ }
32
+
33
+ export interface RouterProps extends RoutableProps {
34
+ history?: CustomHistory;
35
+ static?: boolean;
36
+ url?: string;
37
+ onChange?: (args: RouterOnChangeArgs) => void;
38
+ }
39
+
40
+ export class Router extends preact.Component<RouterProps, {}> {
41
+ canRoute(url: string): boolean;
42
+ getMatchingChildren(
43
+ children: preact.VNode[],
44
+ url: string,
45
+ invoke: boolean
46
+ ): preact.VNode[];
47
+ routeTo(url: string): boolean;
48
+ render(props: RouterProps, {}): preact.VNode;
49
+ }
50
+
51
+ export const subscribers: Array<(url: string) => void>
52
+
53
+ type AnyComponent<Props> =
54
+ | preact.FunctionalComponent<Props>
55
+ | preact.ComponentConstructor<Props, any>;
56
+
57
+ export interface RouteProps<Props> extends RoutableProps {
58
+ component: AnyComponent<Props>;
59
+ }
60
+
61
+ export function Route<Props>(
62
+ props: RouteProps<Props> & Partial<Props>
63
+ ): preact.VNode;
64
+
65
+ export function Link(props: {activeClassName?: string} & preact.JSX.HTMLAttributes): preact.VNode;
66
+
67
+ export class Match extends preact.Component<RoutableProps, {}> {
68
+ render(): preact.VNode;
69
+ }
70
+
71
+ export interface LinkProps extends preact.JSX.HTMLAttributes {
72
+ activeClassName?: string;
73
+ children?: preact.ComponentChildren;
74
+ }
75
+
76
+ export function Link(props: LinkProps): preact.VNode;
77
+
78
+ declare module 'preact' {
79
+ export interface Attributes extends RoutableProps {}
80
+ }
81
+
82
+ export{
83
+ Router,
84
+ Match
85
85
  };
package/package.json CHANGED
@@ -1,113 +1,113 @@
1
- {
2
- "name": "@pixui-dev/pxw",
3
- "version": "0.1.20",
4
- "private": false,
5
- "directories": {
6
- "lib": "lib"
7
- },
8
- "keywords": [],
9
- "author": "",
10
- "license": "ISC",
11
- "description": "",
12
- "bin": {
13
- "pxw": "bin/pxw.js"
14
- },
15
- "files": [
16
- "bin",
17
- "config",
18
- "lib",
19
- "tsconfig.json",
20
- "scripts"
21
- ],
22
- "publishConfig": {
23
- "access": "public"
24
- },
25
- "scripts": {
26
- "b": "npx webpack --mode=production --config config/webpack.js",
27
- "d": "node scripts/run-pxw.js",
28
- "p": "node scripts/pack.js",
29
- "postinstall": "node scripts/postinstall.js"
30
- },
31
- "dependencies": {
32
- "@babel/core": "^7.20.2",
33
- "@babel/plugin-proposal-decorators": "^7.8.3",
34
- "@babel/plugin-syntax-jsx": "^7.8.3",
35
- "@babel/plugin-transform-class-properties": "^7.8.3",
36
- "@babel/plugin-transform-flow-strip-types": "^7.9.0",
37
- "@babel/plugin-transform-optional-chaining": "^7.21.0",
38
- "@babel/plugin-transform-react-jsx": "^7.9.4",
39
- "@babel/preset-env": "^7.20.2",
40
- "@babel/preset-react": "^7.18.6",
41
- "@babel/preset-typescript": "^7.9.0",
42
- "@improbable-eng/grpc-web": "^0.14.1",
43
- "@rollup/plugin-alias": "^4.0.2",
44
- "@rollup/plugin-babel": "^6.0.2",
45
- "@rollup/plugin-commonjs": "^23.0.2",
46
- "@rollup/plugin-node-resolve": "^15.0.1",
47
- "@rollup/plugin-replace": "^5.0.1",
48
- "@tsconfig/svelte": "^2.0.1",
49
- "@types/jest": "25.2.1",
50
- "@types/node": "13.11.1",
51
- "@types/resize-observer-browser": "^0.1.6",
52
- "@types/webpack": "^5.28.5",
53
- "@types/webpack-env": "^1.18.8",
54
- "@typescript-eslint/eslint-plugin": "6.7.5",
55
- "@typescript-eslint/parser": "6.7.5",
56
- "animate.css": "^3.7.2",
57
- "babel-loader": "^8.1.0",
58
- "babel-plugin-import": "^1.12.0",
59
- "babel-plugin-jsx-pragmatic": "^1.0.2",
60
- "babel-plugin-module-resolver": "^4.0.0",
61
- "babel-plugin-transform-decorators-legacy": "^1.3.5",
62
- "babel-plugin-transform-remove-console": "^6.9.4",
63
- "chokidar": "^4.0.3",
64
- "clean-webpack-plugin": "^3.0.0",
65
- "comment-json": "^4.2.5",
66
- "css-loader": "^6.2.0",
67
- "eslint": "8.51.0",
68
- "express": "^4.21.2",
69
- "file-loader": "^6.0.0",
70
- "fork-ts-checker-webpack-plugin": "^9.0.2",
71
- "fs-extra": "^10.0.0",
72
- "html-webpack-plugin": "^5.3.2",
73
- "image-size": "^1.0.0",
74
- "inline-chunk-html-plugin": "^1.1.1",
75
- "less": "^3.11.1",
76
- "less-loader": "^5.0.0",
77
- "memoize-one": "^6.0.0",
78
- "mini-css-extract-plugin": "^2.2.2",
79
- "mobx": "^5.10.1",
80
- "mobx-react": "^6.2.2",
81
- "module-alias": "^2.2.2",
82
- "multer": "^1.4.5-lts.1",
83
- "node-fetch": "2",
84
- "prettier": "2.8.8",
85
- "prettier-eslint": "16.1.1",
86
- "prettier-eslint-cli": "8.0.1",
87
- "random-sentence": "^1.0.4",
88
- "react-dom": "^19.0.0",
89
- "replace": "^1.2.1",
90
- "resolve-url-loader": "^4.0.0",
91
- "rollup": "^3.3.0",
92
- "rollup-plugin-serve": "^2.0.1",
93
- "sass": "^1.26.5",
94
- "sass-loader": "^8.0.2",
95
- "serve-index": "^1.9.1",
96
- "source-map-explorer": "^2.0.1",
97
- "style-loader": "^1.1.3",
98
- "svelte": "^3.42.4",
99
- "svelte-loader": "^3.1.2",
100
- "svelte-preprocess": "^4.9.1",
101
- "systeminformation": "^5.25.11",
102
- "ts-protoc-gen": "^0.10.0",
103
- "tsconfig-paths-webpack-plugin": "^4.2.0",
104
- "typescript": "^3.9.7",
105
- "url-loader": "^4.1.1",
106
- "webpack": "^5.52.0",
107
- "webpack-bundle-analyzer": "^3.7.0",
108
- "webpack-cli": "^5.1.4",
109
- "webpack-dev-middleware": "^6.1.1",
110
- "webpack-dev-server": "^4.15.2",
111
- "yargs": "^17.7.2"
112
- }
113
- }
1
+ {
2
+ "name": "@pixui-dev/pxw",
3
+ "version": "0.1.21",
4
+ "private": false,
5
+ "directories": {
6
+ "lib": "lib"
7
+ },
8
+ "keywords": [],
9
+ "author": "",
10
+ "license": "ISC",
11
+ "description": "",
12
+ "bin": {
13
+ "pxw": "bin/pxw.js"
14
+ },
15
+ "files": [
16
+ "bin",
17
+ "config",
18
+ "lib",
19
+ "tsconfig.json",
20
+ "scripts"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "scripts": {
26
+ "b": "npx webpack --mode=production --config config/webpack.js",
27
+ "d": "node scripts/run-pxw.js",
28
+ "p": "node scripts/pack.js",
29
+ "postinstall": "node scripts/postinstall.js"
30
+ },
31
+ "dependencies": {
32
+ "@babel/core": "^7.20.2",
33
+ "@babel/plugin-proposal-decorators": "^7.8.3",
34
+ "@babel/plugin-syntax-jsx": "^7.8.3",
35
+ "@babel/plugin-transform-class-properties": "^7.8.3",
36
+ "@babel/plugin-transform-flow-strip-types": "^7.9.0",
37
+ "@babel/plugin-transform-optional-chaining": "^7.21.0",
38
+ "@babel/plugin-transform-react-jsx": "^7.9.4",
39
+ "@babel/preset-env": "^7.20.2",
40
+ "@babel/preset-react": "^7.18.6",
41
+ "@babel/preset-typescript": "^7.9.0",
42
+ "@improbable-eng/grpc-web": "^0.14.1",
43
+ "@rollup/plugin-alias": "^4.0.2",
44
+ "@rollup/plugin-babel": "^6.0.2",
45
+ "@rollup/plugin-commonjs": "^23.0.2",
46
+ "@rollup/plugin-node-resolve": "^15.0.1",
47
+ "@rollup/plugin-replace": "^5.0.1",
48
+ "@tsconfig/svelte": "^2.0.1",
49
+ "@types/jest": "25.2.1",
50
+ "@types/node": "13.11.1",
51
+ "@types/resize-observer-browser": "^0.1.6",
52
+ "@types/webpack": "^5.28.5",
53
+ "@types/webpack-env": "^1.18.8",
54
+ "@typescript-eslint/eslint-plugin": "6.7.5",
55
+ "@typescript-eslint/parser": "6.7.5",
56
+ "animate.css": "^3.7.2",
57
+ "babel-loader": "^8.1.0",
58
+ "babel-plugin-import": "^1.12.0",
59
+ "babel-plugin-jsx-pragmatic": "^1.0.2",
60
+ "babel-plugin-module-resolver": "^4.0.0",
61
+ "babel-plugin-transform-decorators-legacy": "^1.3.5",
62
+ "babel-plugin-transform-remove-console": "^6.9.4",
63
+ "chokidar": "^4.0.3",
64
+ "clean-webpack-plugin": "^3.0.0",
65
+ "comment-json": "^4.2.5",
66
+ "css-loader": "^6.2.0",
67
+ "eslint": "8.51.0",
68
+ "express": "^4.21.2",
69
+ "file-loader": "^6.0.0",
70
+ "fork-ts-checker-webpack-plugin": "^9.0.2",
71
+ "fs-extra": "^10.0.0",
72
+ "html-webpack-plugin": "^5.3.2",
73
+ "image-size": "^1.0.0",
74
+ "inline-chunk-html-plugin": "^1.1.1",
75
+ "less": "^3.11.1",
76
+ "less-loader": "^5.0.0",
77
+ "memoize-one": "^6.0.0",
78
+ "mini-css-extract-plugin": "^2.2.2",
79
+ "mobx": "^5.10.1",
80
+ "mobx-react": "^6.2.2",
81
+ "module-alias": "^2.2.2",
82
+ "multer": "^1.4.5-lts.1",
83
+ "node-fetch": "2",
84
+ "prettier": "2.8.8",
85
+ "prettier-eslint": "16.1.1",
86
+ "prettier-eslint-cli": "8.0.1",
87
+ "random-sentence": "^1.0.4",
88
+ "react-dom": "^19.0.0",
89
+ "replace": "^1.2.1",
90
+ "resolve-url-loader": "^4.0.0",
91
+ "rollup": "^3.3.0",
92
+ "rollup-plugin-serve": "^2.0.1",
93
+ "sass": "^1.26.5",
94
+ "sass-loader": "^8.0.2",
95
+ "serve-index": "^1.9.1",
96
+ "source-map-explorer": "^2.0.1",
97
+ "style-loader": "^1.1.3",
98
+ "svelte": "^3.42.4",
99
+ "svelte-loader": "^3.1.2",
100
+ "svelte-preprocess": "^4.9.1",
101
+ "systeminformation": "^5.25.11",
102
+ "ts-protoc-gen": "^0.10.0",
103
+ "tsconfig-paths-webpack-plugin": "^4.2.0",
104
+ "typescript": "^3.9.7",
105
+ "url-loader": "^4.1.1",
106
+ "webpack": "^5.52.0",
107
+ "webpack-bundle-analyzer": "^3.7.0",
108
+ "webpack-cli": "^5.1.4",
109
+ "webpack-dev-middleware": "^6.1.1",
110
+ "webpack-dev-server": "^4.15.2",
111
+ "yargs": "^17.7.2"
112
+ }
113
+ }
package/scripts/pack.js CHANGED
@@ -1,40 +1,40 @@
1
- let path = require('path');
2
- let replace = require('replace');
3
- let cp = require('child_process');
4
- let argv = require('yargs').argv;
5
-
6
- let pkg = require('./package.json');
7
- let { version } = pkg;
8
- let newVersion = version.split('.').map((v) => parseInt(v));
9
- // newVersion[2] += 1;
10
- console.log(version, newVersion);
11
-
12
- let pkgFileName = `wellbye-pxw-${newVersion.join('.')}.tgz`;
13
-
14
- //写一段代码,将 package.json 中的 version 替换为新的版本号
15
- replace({
16
- regex: `"version": "${version}"`,
17
- replacement: `"version": "${newVersion.join('.')}"`,
18
- paths: [path.resolve('./package.json')],
19
- recursive: false,
20
- silent: true,
21
- });
22
- // process.exit(0);
23
-
24
- let dir = [
25
- // '../PixStandRecord/', //
26
- '../pxbattlepass/',
27
- ];
28
-
29
- let runCommand = (command) => {
30
- console.log(command);
31
- cp.execSync(command, { stdio: 'inherit' });
32
- };
33
-
34
- runCommand('npm pack --pack-destination .build/');
35
- dir.forEach((dir) => {
36
- dir = path.resolve(dir);
37
- const libPath = path.join(dir, 'lib');
38
- const pkgPath = path.join('.build', pkgFileName);
39
- runCommand(`rm -rf "${libPath}//wellbye-pxw-*" && cp "${pkgPath}" "${libPath}" && rm -rf $(yarn cache dir)/.tmp && (cd "${dir}" && yarn remove @wellbye/pxw && yarn add file:lib/${pkgFileName}) `);
40
- });
1
+ let path = require('path');
2
+ let replace = require('replace');
3
+ let cp = require('child_process');
4
+ let argv = require('yargs').argv;
5
+
6
+ let pkg = require('./package.json');
7
+ let { version } = pkg;
8
+ let newVersion = version.split('.').map((v) => parseInt(v));
9
+ // newVersion[2] += 1;
10
+ console.log(version, newVersion);
11
+
12
+ let pkgFileName = `wellbye-pxw-${newVersion.join('.')}.tgz`;
13
+
14
+ //写一段代码,将 package.json 中的 version 替换为新的版本号
15
+ replace({
16
+ regex: `"version": "${version}"`,
17
+ replacement: `"version": "${newVersion.join('.')}"`,
18
+ paths: [path.resolve('./package.json')],
19
+ recursive: false,
20
+ silent: true,
21
+ });
22
+ // process.exit(0);
23
+
24
+ let dir = [
25
+ // '../PixStandRecord/', //
26
+ '../pxbattlepass/',
27
+ ];
28
+
29
+ let runCommand = (command) => {
30
+ console.log(command);
31
+ cp.execSync(command, { stdio: 'inherit' });
32
+ };
33
+
34
+ runCommand('npm pack --pack-destination .build/');
35
+ dir.forEach((dir) => {
36
+ dir = path.resolve(dir);
37
+ const libPath = path.join(dir, 'lib');
38
+ const pkgPath = path.join('.build', pkgFileName);
39
+ runCommand(`rm -rf "${libPath}//wellbye-pxw-*" && cp "${pkgPath}" "${libPath}" && rm -rf $(yarn cache dir)/.tmp && (cd "${dir}" && yarn remove @wellbye/pxw && yarn add file:lib/${pkgFileName}) `);
40
+ });
@@ -1,12 +1,12 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- function rmrf(target) {
5
- if (fs.existsSync(target)) {
6
- fs.rmSync(target, { recursive: true, force: true });
7
- console.log(`Deleted: ${target}`);
8
- }
9
- }
10
-
11
- rmrf(path.join(__dirname, '../node_modules/@types/react'));
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ function rmrf(target) {
5
+ if (fs.existsSync(target)) {
6
+ fs.rmSync(target, { recursive: true, force: true });
7
+ console.log(`Deleted: ${target}`);
8
+ }
9
+ }
10
+
11
+ rmrf(path.join(__dirname, '../node_modules/@types/react'));
12
12
  rmrf(path.join(__dirname, '../node_modules/preact'));
@@ -1,13 +1,13 @@
1
- const { spawn } = require('child_process');
2
- const path = require('path');
3
-
4
- process.env.PXW_WATCHFILE = path.join(require('os').homedir(), 'tmp/pxw-reload');
5
-
6
- const child = spawn('node', [path.join(__dirname, '../bin/pxw.js')], {
7
- stdio: 'inherit',
8
- env: process.env,
9
- });
10
-
11
- child.on('exit', code => {
12
- process.exit(code);
1
+ const { spawn } = require('child_process');
2
+ const path = require('path');
3
+
4
+ process.env.PXW_WATCHFILE = path.join(require('os').homedir(), 'tmp/pxw-reload');
5
+
6
+ const child = spawn('node', [path.join(__dirname, '../bin/pxw.js')], {
7
+ stdio: 'inherit',
8
+ env: process.env,
9
+ });
10
+
11
+ child.on('exit', code => {
12
+ process.exit(code);
13
13
  });
package/tsconfig.json CHANGED
@@ -1,30 +1,30 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "target": "es5",
5
- "lib": ["esnext"],
6
- "baseUrl": ".",
7
- "types": ["webpack-env", "resize-observer-browser"],
8
- "paths": {
9
- "preact": ["lib/preact"],
10
- "preact-router": ["lib/preact-router"]
11
- },
12
- "outDir": "dist",
13
- "experimentalDecorators": true,
14
- "allowJs": true,
15
- "skipLibCheck": true,
16
- "esModuleInterop": true,
17
- "allowSyntheticDefaultImports": true,
18
- "strict": true,
19
- "forceConsistentCasingInFileNames": true,
20
- "moduleResolution": "node",
21
- "resolveJsonModule": true,
22
- "noImplicitAny": false,
23
- "typeRoots": ["lib/types", "lib/h5es-types/v1.9.2", "node_modules/@types"],
24
- "jsx": "preserve",
25
- "jsxFactory": "h"
26
- // "noEmit": true
27
- },
28
- "include": ["lib"],
29
- "exclude": ["lib/react-window/", "**/test", "lib/grpc-web/", "lib/pika-svelte/rollup.config.js"]
30
- }
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "target": "es5",
5
+ "lib": ["esnext"],
6
+ "baseUrl": ".",
7
+ "types": ["webpack-env", "resize-observer-browser"],
8
+ "paths": {
9
+ "preact": ["lib/preact"],
10
+ "preact-router": ["lib/preact-router"]
11
+ },
12
+ "outDir": "dist",
13
+ "experimentalDecorators": true,
14
+ "allowJs": true,
15
+ "skipLibCheck": true,
16
+ "esModuleInterop": true,
17
+ "allowSyntheticDefaultImports": true,
18
+ "strict": true,
19
+ "forceConsistentCasingInFileNames": true,
20
+ "moduleResolution": "node",
21
+ "resolveJsonModule": true,
22
+ "noImplicitAny": false,
23
+ "typeRoots": ["lib/types", "lib/h5es-types/v1.9.2", "node_modules/@types"],
24
+ "jsx": "preserve",
25
+ "jsxFactory": "h"
26
+ // "noEmit": true
27
+ },
28
+ "include": ["lib"],
29
+ "exclude": ["lib/react-window/", "**/test", "lib/grpc-web/", "lib/pika-svelte/rollup.config.js"]
30
+ }