@alicloud/alfa-react 1.6.3-alpha.0 → 1.6.4

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/es/version.js CHANGED
@@ -1 +1 @@
1
- export var version = '1.6.3-alpha.0';
1
+ export var version = '1.6.3';
package/lib/version.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- var version = '1.6.3-alpha.0';
7
+ var version = '1.6.3';
8
8
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/alfa-react",
3
- "version": "1.6.3-alpha.0",
3
+ "version": "1.6.4",
4
4
  "description": "Alfa Framework (React Version)",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -40,8 +40,8 @@
40
40
  "crypto-js": "^4.1.1",
41
41
  "prop-types": "^15.8.1",
42
42
  "react-lazyload": "^3.2.1",
43
- "@alicloud/alfa-core": "^1.4.38-alpha.0",
44
- "@alicloud/console-os-loader": "^1.4.42"
43
+ "@alicloud/alfa-core": "^1.4.38",
44
+ "@alicloud/console-os-loader": "^1.4.43"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": ">=16.0.0",
@@ -57,6 +57,7 @@
57
57
  "clean": "rm -rf lib es dist types yarn.lock",
58
58
  "start": "NODE_OPTIONS=--openssl-legacy-provider breezr start-storybook",
59
59
  "precommit": "npm run version",
60
- "version": "node -p \"'export const version = \\'' + require('./package.json').version + '\\';'\" > src/version.ts && git add src/version.ts"
60
+ "version": "node -p \"'export const version = \\'' + require('./package.json').version + '\\';'\" > src/version.ts && git add src/version.ts",
61
+ "postinstall": "node ./scripts/postinstall.js"
61
62
  }
62
- }
63
+ }
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+
3
+ const path = require("path");
4
+ const https = require("https");
5
+
6
+ (async () => {
7
+ try {
8
+ if (typeof process === "undefined" || typeof process.env === "undefined") {
9
+ return;
10
+ }
11
+
12
+ const { BUILD_ENV, INIT_CWD, npm_config_user_agent } = process.env;
13
+ if (BUILD_ENV !== "cloud" || INIT_CWD === process.cwd()) {
14
+ return;
15
+ }
16
+
17
+ const envKeys = [
18
+ "BUILD_GIT_GROUP",
19
+ "BUILD_GIT_PROJECT",
20
+ "BUILD_GIT_BRANCH",
21
+ "BUILD_GIT_COMMITID",
22
+ "BUILD_BUILDER_DIR",
23
+ "BUILD_USER",
24
+ "BUILD_TASK_ID",
25
+ "npm_package_name",
26
+ "npm_package_version",
27
+ "NODE_VERSION",
28
+ "CLOUDBUILD_ENV",
29
+ "CLOUDBUILD_RUNNER_VERSION",
30
+ "BUILD_ENV",
31
+ ];
32
+
33
+ const logEntry = {};
34
+ envKeys.forEach((key) => {
35
+ if (process.env[key]) {
36
+ logEntry[key] = process.env[key];
37
+ }
38
+ });
39
+
40
+ let rootPackage = null;
41
+ try {
42
+ const rootPackagePath = path.resolve(
43
+ INIT_CWD || process.cwd(),
44
+ "package.json"
45
+ );
46
+ rootPackage = require(rootPackagePath);
47
+ } catch (err) {
48
+ // Skip if error occurs
49
+ }
50
+
51
+ let currentPackage = null;
52
+ try {
53
+ const currentPackagePath = path.resolve(__dirname, "../package.json");
54
+ currentPackage = require(currentPackagePath);
55
+ } catch (err) {
56
+ // Skip if error occurs
57
+ }
58
+
59
+ if (rootPackage) {
60
+ logEntry.root_package = JSON.stringify(rootPackage);
61
+ }
62
+ if (currentPackage) {
63
+ logEntry.name = currentPackage.name;
64
+ logEntry.version = currentPackage.version;
65
+ }
66
+
67
+ const payload = {
68
+ __topic__: "package_postinstall",
69
+ __logs__: [logEntry],
70
+ };
71
+
72
+ const body = JSON.stringify(payload);
73
+ const options = {
74
+ hostname: "alfa.log-global.aliyuncs.com",
75
+ path: "/logstores/package-usage-telemetry/track",
76
+ method: "POST",
77
+ headers: {
78
+ "Content-Type": "application/json",
79
+ "x-log-apiversion": "0.6.0",
80
+ "user-agent": npm_config_user_agent || "",
81
+ },
82
+ timeout: 5000,
83
+ };
84
+
85
+ const req = https.request(options, (res) => {
86
+ res.on("data", () => {});
87
+ });
88
+
89
+ req.on("error", () => {});
90
+ req.write(body);
91
+ req.end();
92
+ } catch (err) {
93
+ // Catch all errors and ignore
94
+ }
95
+ })();
96
+
@@ -1 +1 @@
1
- export declare const version = "1.6.3-alpha.0";
1
+ export declare const version = "1.6.3";