shuvi 1.0.5 → 1.0.6
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/lib/shuvi.js +13 -1
- package/lib/tasks/build.js +1 -9
- package/package.json +8 -8
package/lib/shuvi.js
CHANGED
|
@@ -24,19 +24,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.initShuvi = exports.getPlatform = void 0;
|
|
27
|
+
const telemetry_1 = require("@shuvi/telemetry");
|
|
27
28
|
const service_1 = require("@shuvi/service");
|
|
28
29
|
const platform_web_1 = __importDefault(require("@shuvi/platform-web"));
|
|
29
30
|
const config_1 = require("./config");
|
|
31
|
+
//@ts-ignore
|
|
32
|
+
const package_json_1 = __importDefault(require("../package.json"));
|
|
30
33
|
function getPlatform() {
|
|
31
34
|
return (0, platform_web_1.default)({ framework: 'react' });
|
|
32
35
|
}
|
|
33
36
|
exports.getPlatform = getPlatform;
|
|
37
|
+
const TELEMETRY_ENDPOINT = '';
|
|
34
38
|
function initShuvi(_a) {
|
|
35
39
|
var { config } = _a, options = __rest(_a, ["config"]);
|
|
36
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
41
|
const { plugins, presets } = config, restConfig = __rest(config, ["plugins", "presets"]);
|
|
42
|
+
const telemetry = TELEMETRY_ENDPOINT
|
|
43
|
+
? new telemetry_1.Telemetry({
|
|
44
|
+
name: 'Shuvi.js',
|
|
45
|
+
meta: { shuviVersion: package_json_1.default.version },
|
|
46
|
+
postEndpoint: TELEMETRY_ENDPOINT
|
|
47
|
+
})
|
|
48
|
+
: undefined;
|
|
38
49
|
const shuvi = yield (0, service_1.getApi)(Object.assign(Object.assign({}, options), { plugins,
|
|
39
|
-
presets, config: restConfig, platform: getPlatform(), normalizePlatformConfig: config_1.normalizePlatformConfig
|
|
50
|
+
presets, config: restConfig, platform: getPlatform(), normalizePlatformConfig: config_1.normalizePlatformConfig,
|
|
51
|
+
telemetry }));
|
|
40
52
|
return shuvi;
|
|
41
53
|
});
|
|
42
54
|
}
|
package/lib/tasks/build.js
CHANGED
|
@@ -40,12 +40,9 @@ const path = __importStar(require("path"));
|
|
|
40
40
|
const fs = __importStar(require("fs-extra"));
|
|
41
41
|
const formatWebpackMessages_1 = __importDefault(require("@shuvi/toolpack/lib/utils/formatWebpackMessages"));
|
|
42
42
|
const service_1 = require("@shuvi/service");
|
|
43
|
-
const telemetry_1 = require("@shuvi/telemetry");
|
|
44
43
|
const constants_1 = require("@shuvi/shared/lib/constants");
|
|
45
44
|
const logger_1 = __importDefault(require("@shuvi/utils/lib/logger"));
|
|
46
45
|
const shuvi_1 = require("../shuvi");
|
|
47
|
-
//@ts-ignore
|
|
48
|
-
const package_json_1 = __importDefault(require("../../package.json"));
|
|
49
46
|
const defaultBuildOptions = {
|
|
50
47
|
target: 'ssr'
|
|
51
48
|
};
|
|
@@ -77,11 +74,6 @@ function copyPublicFolder(context) {
|
|
|
77
74
|
function build(options) {
|
|
78
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
76
|
const opts = Object.assign(Object.assign({}, defaultBuildOptions), options);
|
|
80
|
-
//TODO: update end point
|
|
81
|
-
const telemetry = new telemetry_1.Telemetry({
|
|
82
|
-
meta: { shuviVersion: package_json_1.default.version },
|
|
83
|
-
postEndpoint: ''
|
|
84
|
-
});
|
|
85
77
|
const api = yield (0, shuvi_1.initShuvi)({
|
|
86
78
|
cwd: opts.cwd,
|
|
87
79
|
mode: 'production',
|
|
@@ -101,7 +93,7 @@ function build(options) {
|
|
|
101
93
|
// transpile the application
|
|
102
94
|
yield bundle(bundler);
|
|
103
95
|
yield pluginContext.pluginRunner.afterBuild();
|
|
104
|
-
yield (0, service_1.analysis)({ context: api.pluginContext, telemetry });
|
|
96
|
+
yield (0, service_1.analysis)({ context: api.pluginContext, telemetry: api.telemetry });
|
|
105
97
|
return api;
|
|
106
98
|
});
|
|
107
99
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shuvi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/shuvijs/shuvi.git",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"node": ">= 12.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@shuvi/platform-shared": "1.0.
|
|
29
|
-
"@shuvi/platform-web": "1.0.
|
|
30
|
-
"@shuvi/service": "1.0.
|
|
31
|
-
"@shuvi/shared": "1.0.
|
|
32
|
-
"@shuvi/toolpack": "1.0.
|
|
33
|
-
"@shuvi/utils": "1.0.
|
|
34
|
-
"@shuvi/telemetry": "1.0.
|
|
28
|
+
"@shuvi/platform-shared": "1.0.6",
|
|
29
|
+
"@shuvi/platform-web": "1.0.6",
|
|
30
|
+
"@shuvi/service": "1.0.6",
|
|
31
|
+
"@shuvi/shared": "1.0.6",
|
|
32
|
+
"@shuvi/toolpack": "1.0.6",
|
|
33
|
+
"@shuvi/utils": "1.0.6",
|
|
34
|
+
"@shuvi/telemetry": "1.0.6",
|
|
35
35
|
"cli-highlight": "^2.1.9",
|
|
36
36
|
"commander": "5.1.0",
|
|
37
37
|
"cross-spawn": "7.0.3",
|